I am trying to import excel file using phpexcel library.
The excel file contains Name Ranges
(which takes data from table in another sheet of same excel file) for data lookup in cells.
I found the function in phpexcel library called getNamedRanges()
which is supposed to list the named ranges from excel file. But it returns an empty array.
Code:
<?php
$inputFileType = 'Excel2007';
$inputFileName = $uploads_file;
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setLoadAllSheets();
$objPHPExcel = $objReader->load($inputFileName);
$ranges = $objPHPExcel->getNamedRanges();
var_dump($ranges);
When phpexcel tries to lookup data in range, It throws an exception.
Is there any specific method/s in phpexcel, that I am missing which considers the named ranges defined in excel while formula calculation?