Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation and Formatting Cells (Columns)
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00710938
Message ID:
00711190
Views:
19
You might try this. You can format cells and columns. If you set macro record on (in excel), you can read 'gross' VBA that you can use for your VFP.
With oExcel
   .....
   .Columns("Q:Q").Select
   .Selection.ColumnWidth=8
   .Selection.NumberFormat="0.000000"
   .....
endwith
>Unfortunately this is not an option. The spread sheets are used for reports and to move data to other systems.
>
>
>
>>>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.
>>
>>Fred,
>>
>>What I do to avoid this is..
>>
>>When a field is of type T_CHARACTER or T_MEMO
>>
>>xlSheet.Cells[nRow,i].Value = ['] + Table.Field
>>
>>This is basically what you do in excel. If you want 600 to be treated as a string you enter '600
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform