>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