Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating Excel, Wordpad, Notebook etc.
Message
From
07/05/2004 08:05:25
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00901660
Message ID:
00901884
Views:
15
>Just one thing though. I recorded a macro as I opened up one of my w/s, and got:
>
>Workbooks.Open Filename:="C:\Temp\exports\C3AN0200.XLS"
>
>After I've exported my VFP table to excel I want to open the w/s and change the col. headings to those of my field captions. Do I take it that this would translate, in VFP, to something like:
>
>loExcel.Workbooks.Open Filename:="C:\Temp\exports\C3AN0200.XLS" ?
>

No, VFP doesn't use named parameters. When you translate from a macro to VFP Automation code, you have to replace named parameters with positional parameters. Your example becomes:

loExcel.Workbooks.Open("C:\Temp\exports\C3AN0200.XLS")

In general, the Excel VBA Help file is invaluable here. In addition, as others said, the book Della Martin and I wrote has a lot of this in it, as well as a whole chapter really devoted to the question of how you learn what commands are available.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform