I am using a 3rd party package called ExcelWriter from Softartisans to create report spreadsheets. They have a VB example of how to set the cell width as:
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set Cells = XlwApp.Worksheets(1).Cells
'--- Set column width for the third column to 10
Cells.ColumnWidth(3) = 10
I have a php function to do the same thing. It follows:
function cellWidth($wkbk,$sheet,$col,$value) {
$tmp = $wkbk -> worksheets($sheet);
$tmp = $tmp->cells;
$tmp->ColumnWidth($col) = $value;
}
When I run this, I get a PHP parse error of "unexpected '=' ". Any ideas of how I can get around this?
Also, is there a better/proper way to access the methods/properties than the way I am doing it? It seems that PHP does not like it when a '->' follows a value in parenthesis, such as $sheet and $col in the example.