Not sure what you mean by "name column headers", but if you know how to do it in Excel, just record an Excel macro to do it and look at the VB code that gets generated. Should give you everything you need.
While Mike's suggestion is, in general, the best one and certainly the most flexible, there is an alternative approach if your Row1 (header) values are changing.
I manually create a fixed Header.xls file in Excel and store it in a known disk location. This need only be done once per Header file.
Within the VFP application I use Excel Automation to create the new Excel data file.
After that, I merely use Excel Automation to Insert a new Row1 and copy Header.xls into the new Row1 of the new data file.
That is reasonably easy to accomplish and minimizes the Excel Automation code required.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.