Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word SaveAs
Message
 
To
27/01/2000 13:58:56
Victoria Mckee
Kansas City Life Insurance Co
Kansas City, Missouri, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00323592
Message ID:
00323737
Views:
22
>Nick,
>
>What a clean solution.
>
>Thanks. I will give it a try.
>
>Victoria

Also, when you see the VBA code which you try to use for Office automation with VFP, look at VBA help for this function which lists all the parameters and just translate it to VFP way:

myObject.ThatFunction(param1, param2, param3...)

Usually it is easy to tell what is the type of the parameter. Sometimes it is can cause the confusion like in case of moving the Excel spreadsheets in a workbook

The VBA macro for this reads like:

Sheets("MySheet").Select
Sheets("MySheet").Move Before:=Sheets(9)

If you try to substitute the parameter with worksheet name or number it does not work because it has to be the object reference:

oWorkbook =YourExcelObject.ActiveWorkbook
*** moving worksheet3 before worksheet1
oBefore = oWorkbook.Sheets(1)
oWorkbook.Sheets(3).Move(oBefore)

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform