Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Office Automation - Excel Question
Message
 
To
14/08/2009 15:16:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows NT
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01418163
Message ID:
01418166
Views:
89
>When using VFP to create an Excel file through Office Automation, how do you programically "automatically" adjust the column widths to the longest piece of data in each column? In other words, I want to accomplish the same thing I can do with a mouse by double clicking the Excel A/B/C column header bar column dividing lines when the mouse changes to a spliter icon.
>
>Thanks,
>Robert

NOT TESTED!!!
oExcel.Activeworkbook.Cells.Select()
oExcel.Activeworkbook.Cells.EntireColumn.AutoFit()
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform