John,
I keep getting an OLE error when trying to run an Excel macro using OLE Automation. I have searched everywhere for a solution and can't find anything. I was wondering if you've ever tried to run an Excel macro using VFP or VB.
I first tried an Auto_Activate macro. It worked fine if I opened the workbook using Excel, but when I used VFP 5.0 and OLE Automation to open the workbook it would not run the macro. So I renamed the macro to "Master" and tried to run it after the workbook was already open.
The macro actually runs but I get the following message afterward:
OLE error code Ox800a9c68: Unknown OLE status code
I tried it in VFP 6.0 and got this:
OLE error code Ox800a9c68: Unknown COM status code
Here is the code I'm using.
oEXCEL = CREATEOBJECT("Excel.Application")
oEXCEL.Workbooks.Open("MACROS.XLS")
oEXCEL.Application.Run("'MACROS.XLS'!Master")
oEXCEL.QUIT()
RELEASE oEXCEL
I did find a similar confirmed bug ("Unknown COM status code" With ActiveX Conferencing Control) that was corrected in Visual Studio 6.0 Service Pack 3.
Could this just be another bug?
Any help would be appreciated.
Thanks,
Mike Coop
MIU - Data Analyst III
Kemper a Unitrin Business
(904) 245-5949
mcoop@eKemper.com