Hi friends,
I am using phpexcel library to import excel files. When I acquire the Phpexcel object after loading the file, I loop around all the sheets to read their data. I need to know the tab color of the worksheets to branch my code so I am using Worksheet->getTabColor() function to access it but it is returning null. It seems that the worksheet tab color is getting read by the library.
My code is like this:-
I am using phpexcel library to import excel files. When I acquire the Phpexcel object after loading the file, I loop around all the sheets to read their data. I need to know the tab color of the worksheets to branch my code so I am using Worksheet->getTabColor() function to access it but it is returning null. It seems that the worksheet tab color is getting read by the library.
My code is like this:-
$excelReader = PHPExcel_IOFactory::createReader($writer);
$excelReader->setReadDataOnly(FALSE);
$excelReader->setLoadAllSheets(TRUE);
$excelObj = $excelReader->load($file);
$worksheetNames = $excelObj->getSheetNames($file);
foreach ($worksheetNames as $sheetName) {
var_dump($excelObj->getSheetByName($sheetName)->getTabColor());
}
Every time it is returning printing null. Please help somebody.