I used VB6 to display reports in Ms excel 2003. but I have a problem with the columns width. I wrote this code to control the width: (for example)
xlsheet.Columns("A:A").ColumnWidth = 2.29
the problem is that this width depends on the computer I am working on. i.e they fit perfectly on this PC but they are too wide in the any other PC even though the width is the same 2.29
Is there a way around this problem?
I've never heard about this kind of issue, nor was I able to find info about it... Does it also happen if you try to replicate the problem with a new and blank file? Any differences in Excel version or installed service packs between your pc and the others?
Sorry for the delay.
The only way I can now that the width is not the same is that the columns in one PC are contained in one page and two pages in the other.
If I use the 1st PC to generate the Excel file and try to display it in the 2nd PC, I won’t have this problem. It happens only when I use my VB program which specify the width of the columns.
I tried to use the autofit command, so it will fit the width of the columns around the text but it is giving me an error: Autofit method of Range class failed.
is that because there are some empty cells? If so is there some other command I can use?