Call to macro in OLE object not found
I have a VFP 5.0 app which creates an Excel application object then
opens a workbook and calls various macros stored in the workbook. ( I am
using Excel v. 7.0a)
On the first macro that VFP calls I frequently get an OLE error saying
the macro can't be found. This only happens *some* of the time.
Several other macros (also stored in the same workbook - all have
parameters passed from VFP) are called from within VFP using the same
type of object referencing with no problem. For some reason it is only
the one macro and only some of the time. Does anyone have any idea why
this would be so?
Not sure if this is helpful but here is VFP code that calls it...
oWkBook = GETOBJECT("C:\MyPath\MyWorkbook.xls")
oWkBook.application.visible=.T.
oWkBook.application.workbooks("MyWorkbook.xls").Activate
oWkBook.application.run("MyWorkbook!MyMacro", cParaRef)
In addition, to get this one to *ever* work I had to reference it as
Workbook!Macro. All the others can be called just fine with only
oWkBook.application.run("MyMacro", parameters)
TIA for your help.
Rose Eby