Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invoking Excel Macro From Within Foxpro
Message
From
31/08/1999 18:12:45
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00259829
Message ID:
00259949
Views:
10
Hi Jeff --- Try

=ObjExcel.Run("personal.xls!macro1")

>I need to invoke a Excel macro, stored in personal.xls, within the workbook/sheet ast1.xls. The code now is:
>
>*=====
>* Create a reference to Excel
>objExcel = CreateObject("Excel.Application")
>
>* Open personal workbook
>cFileName = "w:\work\output\personal.xls"
>objBook = objExcel.WorkBooks.Open(cFileName)
>
>* Open ast1 workbook
>cFileName = "w:\work\output\ast1.xls"
>objBook = objExcel.WorkBooks.Open(cFileName)
>
>* Make Excel visible so you can see the show
>objExcel.Visible = .T.
>
>*INVOKE THE MACRO
>application.run "personal.xls!macro1"
>*=====
>
>Everything opens fine, but the macro is not invoked.
>Any ideas that would make this work?
>
>Thanks.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform