Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating Excel, Wordpad, Notebook etc.
Message
From
06/05/2004 16:02:47
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00901660
Message ID:
00901739
Views:
16
>It's one thing to be able to get, say, an Excel w/s up, it's another to be know what the commands are. for example, I
can get Excel to start from VFP but how do I know what the commands are to, say, open a particular w/s, move to cell(A,13).
>
>Essentially I need to open up certain Excel w/s or CSV files (in either Excel or a text editor). How do I get a list of valid commands, etc., within those app's, so as to make them do my bidding?


Basically, the most common way is to open the macro recorder in Excel (Tools->Macros->Record Macro).
Accept the default dialog by pressing OK.
Do whatever you need in the spreadsheet then stop the recorder.
Now press ALT-F11 in Excel to go to the VBA editor.
Open the Modules tree node. Module1 will be your first recording.
Double-click on it and you will see the VBA-generated code.

It is generally fairly easy to translate to VFP.
Just prepend almost everything with your object reference to Excel (e.g. oExcel) plus a dot.
If you get stuck on a particular VBA command or function, ask away and we'll try to help.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform