phplaravelphpspreadsheetddephpoffice-phpspreadsheet

Not able to read file with live data which is a calculation from another application (DDE function)


I'm trying to read an XLS file. Data of which is being updated by an external application through a formula (DDE function). So, the file is getting updated every second. When I try to read the file, I'm getting the below error.

Error:

ErrorException: Uninitialized string offset 0 in file C:\xampp\htdocs\gold-rate\gold-rate-web-test\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Xls.php on line 7803

Code:

$inputFileType = 'Xls';
$inputFileName = 'sources/win.xls';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
$spreadsheet = $reader->load($inputFileName);

How can I read the file? Thanks in advance!


Solution

  • I've fixed the issue with the help of this post,

    https://marcelwijayacc.wordpress.com/2011/09/22/obtaining-live-data-feed-from-excel-or-any-windows-object-using-php/