>Does anyone have a code example of formatting a cell through automation?
>
>I create spread sheets through automation and unfortunately, some columns have numbers with leading zeros. The leading zeros are removed unless I change category to text in the Format Cells dialog.
>
>Thanx.
Hi Fred
I posted one small Excel automation class in download section here on UT.
It is called 'rep2excel' and is posted 26 of september.
Full source is provided - so I guess you can find some examples of how to do that.
Class itself can perform such thing by issuing code like this;
oXl.make_cell_format(nSheet,nRow,nCol,cFormat)
where cFormat is one of these funny excel format strings
and nSheet,nRow,nCol numeric cell coordinates
and then you can issue
oXl.make_cell(nSheet,nRow,nCol,vValue)
Hope this can help you.