getStyle does not get font name or size

Topics: Developer Forum, User Forum
May 27, 2014 at 3:55 PM
I'm using PHPExcel 1.8.0. OS = Slackware 14.1, 3.2.45 kernel. PHP 5.5.12.

$filename = '/tmp/test.xlsx';
require_once '/home/me/library/PHPExcel/IOFactory.php';
$objPHPExcel = PHPExcel_IOFactory::load($filename);
$style = $objPHPExcel->getSheet(0)->getStyle('A1');

When I do this, $style is a PHPExcel_Style object as expected, but the _font _name is wrong, as is the _size. It looks like it is the default and is ignoring what is actually in the spreadsheet test.xlsx.

Am I missing something? Shouldn't the style object have the font name and size that is used in the referenced cell? I'm not quite sure where to go from here. If I do this:

$data = $objPHPExcel->getActiveSheet()->toArray(null,false,true,true);

The $data has the correct data from the spreadsheet, which tells me that objPHPExcel is instantiated properly and has loaded my spreadsheet.

How would I go about getting the current style of the cell, including font name and size?