getDefaultStyle() deprecated

Topics: Developer Forum
Jan 18, 2013 at 9:45 AM

Hi, I am new to PHPExcel.


How do I set the default font for the whole worksheet? The solution with getDefaultStyle() works, but the new version of PHPExcel (1.7.8) says that getDefaultStyle() is deprecated. Unfortunately, neither the API nor Google has been able to help me find an alternative way to set the font size for an entire worksheet without using getDefaultStyle().

Any ideas? 

PHP 5.4.6

Ubuntu 12.10

Jan 23, 2013 at 11:44 AM


Sets a default style for the whole workbook (all worksheets).


It is the worksheet's getDefaultStyle() method that has been deprecated, because all that it actually does is set the workbook default style, and this could lead to confusion if people believe that they can have default styles for each individual worksheet within a workbook.

The workbook getDefaultStyle() method hasn't been deprecated.

Jan 24, 2013 at 4:54 PM

Thanks for the explanation.