-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Invalid cell coordinate error #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please provide a MCVE without relying on an external to reproduce the issue. |
|
I having same issue today: Invalid cell coordinate AAAC2 ["[object] (PhpOffice\PhpSpreadsheet\Exception(code: 0): Invalid cell coordinate AAAC2 at |
Cell coordinate AAAC2 is invalid. Excel does not permit columns beyond XFD (which is how |
I do not understand how this issue is closed without any investigation. But to reproduce this is very simple: Just create a large. CSV (my case was with .csv extension) file with 800+ lines and at least 20 columns. You'll see it happening while you're trying to read. |
The issue was closed over 5 years ago. The fact that you added a comment to it 4 days ago did not reopen it. Nevertheless, based on the incomprehensibly small amount of information you supplied, PhpSpreadsheet was acting correctly, and I explained why. There was certainly no reason to reopen it based on that. You have now supplied new information which may or may not change my assessment. When I get a chance, I will try to use that information to see if I can duplicate your symptom. However, it will make things quicker if you can supply the CSV (or a program which generates it), and a program which fails in the manner you describe when PhpSpreadsheet tries to read it. |
The following code, based on your "reproduce" instructions above, performs hideously, but that's not what this issue is about. use PhpOffice\PhpSpreadsheet\Reader\Csv;
$row = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21\n";
$maxRows = 850000;
$filename = 'issue.381.csv';
echo "creating $filename\n";
$fh = fopen($filename, 'wb');
for ($i = 0; $i < $maxRows; ++$i) {
if ($i % 10000 === 9999) {
echo "writing row $i\n";
}
fwrite($fh, $row);
}
fclose($fh);
echo "file is written - starting read\n";
$reader = new Csv();
$spreadsheet = $reader->load($filename);
echo "read is complete\n";
$sheet = $spreadsheet->getActiveSheet();
var_dump($sheet->getCell('T99')->getValue()); // expect int(20)
var_dump($sheet->getCell('D810000')->getValue()); // expect int(4) When the code finally completes, I do not see any exception messages, and the var_dumps show the expected results. So, there is apparently more to your problem than what you have posted so far. At any rate, when you do have a reproducible bug, please open a new issue, rather than adding on to this one. |
Investigating issue PHPOffice#381, a means was suggested to duplicated a problem, but no problem occurred ... except for performance. This involved a spreadsheet with a large number of cells, definitely not PhpSpreadsheet's strong point; even so, the program (entirely available in the issue) took a disastrous two or so hours to complete on my system. Looking at the Csv Reader code, several opportunities to cache results and avoid function calls jumped out, none of which seem to materially add to the maintenance burden of the program. Testing these changes resulted in a run time of about 20 minutes, still hardly a thing of beauty, but a huge improvement over the original and therefore worth proceeding with.
Hi, I'm providing my file example (without the real data but with the right numbers of headers + cols) to contribute. The attachment |
I still don't see a problem. $filename = 'issue.381c.csv';
echo "starting read\n";
$reader = new Csv();
$spreadsheet = $reader->load($filename);
echo "read is complete\n";
$sheet = $spreadsheet->getActiveSheet();
var_dump($sheet->getCell('T99')->getValue()); // expect V98
var_dump($sheet->getCell('AR243')->getValue()); // last cell - expect V242 Program output:
|
* Performance Improvements for Csv Reader Investigating issue #381, a means was suggested to duplicated a problem, but no problem occurred ... except for performance. This involved a spreadsheet with a large number of cells, definitely not PhpSpreadsheet's strong point; even so, the program (entirely available in the issue) took a disastrous two or so hours to complete on my system. Looking at the Csv Reader code, several opportunities to cache results and avoid function calls jumped out, none of which seem to materially add to the maintenance burden of the program. Testing these changes resulted in a run time of about 20 minutes, still hardly a thing of beauty, but a huge improvement over the original and therefore worth proceeding with. * Redo CsvIssue2232Test Test cases included duplicates, and didn't account for some things (e.g. French locale will treat both 'vrai' and 'true' as true). * Additional Optimization
This is:
What are the steps to reproduce?
When I load a template which has a formula e.g. =SUM(Sheet2!E:E) it causes an error. Other similar formulas don't cause the error like =SUM(Sheet2!E2:E27) or =SUM(E:E).
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
The text was updated successfully, but these errors were encountered: