General information
Category:
COM/DCOM and OLE Automation
Title:
Invoking Excel Macro From Within Foxpro
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.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only