Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running a Macro in Excel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Running a Macro in Excel
Divers
Thread ID:
00310684
Message ID:
00310684
Vues:
60
I am having trouble getting a macro to run in Excel once I have the workbook open. I first tried an Auto_Activate macro. It worked fine if I opened the workbook using Excel. 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 just run it once the workbook was open.

Here is the code I'm using. The macro actually runs but I get an OLE error code Ox800a9c68, Unknown OLE status code.

oEXCEL = CREATEOBJECT("Excel.Application")
oEXCEL.Workbooks.Open("\MACROS.XLS")
oEXCEL.Application.Run("'\MACROS.XLS'!Master")

Any help would be appreciated.

Thanks,
Mike
Mike Coop
MIU - Data Analyst III
Kemper a Unitrin Business
(904) 245-5949
mcoop@eKemper.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform