MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Execute Excel Macros From Access?

Posted by JohnH on June 26, 2001 7:49 AM

Can I call and execute Macros (in the Excel Workbook) from my application in Access? If so how do I go about this?

Basicaly, I want to call execute a Macro in my Excel workbook that transfers data from one worksheet to another, then transfer this new data into my Access Database and then delete the records in my Excel Worksheet so the whole process can repeat itself as needed in the future. The Excel workbook is being updated by various users and it is basically a holding tank for the Access Database.



Posted by Russell on June 26, 2001 9:32 AM

You can do something like this:

Dim xlw As Excel.Workbook

xlw.Application.Run "Macro Name"

Hope this helps,


Posted by Russell on June 26, 2001 9:33 AM

One more thing

xlw.Application.Run "Macro Name"

Also, you must have a reference to the Microsoft Excel X.x Library -- under Tools - References in Access.

Posted by doug on August 15, 2001 9:05 AM

this article says it all

Now my problem is i call the Excel from Access but can't get the Auto_Open to run, even using the RunAutoMacros
I don't get it. xlw.Application.Run "Macro Name"