There is another behavior of the column width when you save the file as TXT with fix Width I found that the column width is use to create the file i.e. a column with a 15 width will result in a 15 spaces long column on the exported file.
Bernardo
>James,
>
>from the Excel help:
The number that appears in the Standard column width box is the average number of digits 0-9 of the standard font that fit in a cell. >
>I think I'd avoid trying to worry about the actual widths and just fire off the autofit process:
>
>
> Cells.Select
> Cells.EntireColumn.AutoFit
>
>
>
>I'm not sure if you can tell via automation how many horizontal pages the output will span. Tamar and Della's Office Automation book might give some detail on this.
>
>>What is the unit of measure for column widths in Excel? On my machine, it appears that column widths are in multiples of 1/7 (how odd!), and that one inch on a printed page corresponds to 12 units.
>>
>>Are thes values constant? If not, is it possible to determine what these values are?
>>
>>I ask because I have an application with lots of grids, and I print them by exporting them to Excel and printing from there. The preference is to print them in Portrait,
unless all the columns across do not fit on one page, but would fit if they were printed in Landscape.
>>
>>So, as I set the margins before printing, the real question is: How can I tell if all my columns will not fit if printed portrait, but will print if printed landscape?
>>
>>P.S.: Based upon user choices, there can be a variable number of columns in all my grids, and the user can change the column widths as well, so the determination of the actual printing width must be done at print time.
B.D.H.