Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel - Macro execution
Message
From
06/07/2000 15:25:29
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00389030
Message ID:
00389061
Views:
20
Thanks a lot Larry

>>I need to execute an Excel macro from within VFP. I already have the code to open the worksheet and close it once the macro has finished. However I can't find the way to launch such macro.
>>
>>
>>Thanks in advance for any help.
>>
>>Oscar Corte
>
oExcel = createobject("excel.application")
>With oExcel
>   .Workbooks.Open("MySpreadsheet.XLS")
>   .Run("MyMacro")
>   .Workbooks(1).Close()
>Endwith
>The macro must be public. This means if it doesn't show up in the Tools - Macro - Macros list, it can't be run.
Previous
Reply
Map
View

Click here to load this message in the networking platform