>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.Robert,
You can use the AutoFit method off of the Columns collection:
oWorkSheet.Columns("A:C").AutoFit()
Jon
Jon Rosenbaum
Devcon Drummer