Setting width in pixel in Excel

S

Sonnich Jensen

Hi all

I am trying to set the width of coloumns to 16 pixels. I know I cannot
set that directly, so in stead I try to set the columnwidth, and
adjust it by reading the width.
Result: A is alway 0 - hidden :) and the following C E etc are 22
pixels, 1.57 chars.

What do I do wrong?

WBR
Sonnich

for($j=0;$j<$h;$j++)
{
$WB->Sheets(1)->Columns($j*2+1)->ColumnWidth=1;
while($WB->Sheets(1)->Columns($j*2+1)->Width < 16)
$WB->Sheets(1)->Columns($j*2+1)->ColumnWidth =
$WB->Sheets(1)->Columns($j*2+1)->ColumnWidth + 0.1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top