When I try to open/read the spreadsheet (xls), I get the following error:
Scale must be greater than or equal to 1
I am using the following code to open and read the file:
$filename = 'test.xls';
$spreadsheet = IOFactory::load($filename); //<-- ERRORS HERE
$worksheet = $spreadsheet->getActiveSheet();
The error occurs on the ::load
command.
It isn't a data issue - I can copy the existing data into a new file and it works correctly, so must be an issue with the file itself.
I am using v1.6.0 of PHPSpreadsheet, which is the latest at time of writing.
Thanks in advance!
EDIT:
This question relates to PHPSpreadsheet, not PHPExcel as listed here: PHPExcel Error: Scale must be greater than or equal to 1
Though similar, an XLSX version of my file works as expected, hence the need to create a separate question. PHPExcel is also now marked as officially dead, so seems logical to add this question to the correct library / tag on SO.
I have since found a solution to the problem (added below), which may also work in PHPExcel, but comes with no warranties!