Results 1 to 2 of 2
Thread: Using COM with Excel...
Oct 16, 2010, 23:37 #1
Using COM with Excel...
I'm having a hard time "targeting" the row within an Excel file I've managed to create using COM. I thought it would be the following:
$cell->Rows(1,1)->RowHeight = "51";
...but it didn't work, nor did various other attempts...
What's a basic procedure (using PHP 5) to change a row's height value prior to write out? Here's what I have so far:
$cell->value = $name;
$cell->WrapText = "True";
Rows(1)->RowHeight = 51.75;//something wrong...
Oct 19, 2010, 16:11 #2
So I managed to find the solution (albeit possibly inefficient, etc.):
$column_a->ColumnWidth = '2';
So anyway, I guess my original code was correct? I think something that occurred in doing this for me had to do with how messy the memory management was / is for using PHP and Excel. I noticed in my Taskmanager that I had MANY instances of Excel running and when I would go to "refresh" my page, it would nosedive. After eliminating those erroneous instances, it then seemed to work...
Now I just need to know how to center text horizontally in a cell. Anyone?