Skip to content
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

cant read xls file #537

Closed
darkworks opened this issue Jun 6, 2018 · 1 comment
Closed

cant read xls file #537

darkworks opened this issue Jun 6, 2018 · 1 comment
Labels

Comments

@darkworks
Copy link

darkworks commented Jun 6, 2018

am trying to read xls file and am getting error , although i had no problem with reading xlsx files , i had same problem with xls file when i was using old phpexcel lib , just migrated to this new version but looks like xls file issue still not patched
error am getting ::

`Fatal error: Uncaught exception 'PhpOffice\PhpSpreadsheet\Reader\Exception' with message 'The filename ../uploads/false/xy_data_file/comp_place.xls is not recognised as an OLE file' in include\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Shared\OLERead.php:111 Stack trace: #0 include\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Xls.php(1363): PhpOffice\PhpSpreadsheet\Shared\OLERead->read('../uploads/fals...') #1 include\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Xls.php(628): PhpOffice\PhpSpreadsheet\Reader\Xls->loadOLE('../uploads/fals...') #2 gxy_reader.php(88): PhpOffice\PhpSpreadsheet\Reader\Xls->load('../uploads/fals...') #3 {main} thrown in ``

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:

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
	$spreadsheet = $reader->load($inputFile);
	$objWorksheet = $spreadsheet->getActiveSheet();   // active sheet data
	$reader->setReadDataOnly(true);  // only data no formating styles etc
	$highestRow = $objWorksheet->getHighestRow();
	$highestColumn = $objWorksheet->getHighestColumn();
	$highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($highestColumn); 



### Which versions of PhpSpreadsheet and PHP are affected?
using latest version i think its 1.2 just installed with composer .
@darkworks darkworks reopened this Jun 6, 2018
@PowerKiKi
Copy link
Member

When reporting issue, please fill the template, be mindful of formatting, and provide everything needed to replicate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants