Run Excel Macro from Access

G

Guest

Is it possible to run an excel macro that i have already created in an access?

I was thinking of running this excel macro in an Access Macro. Is there a
function such as "TransferSpreadsheet" or the like that would run this Excel
Macro?

The macro that I have created in Excel essentially opens spreadsheet "A",
formats data in spreadsheet "A", then saves as spreadsheet "B".

Ryan
 
M

Michael Bednarek

Is it possible to run an excel macro that i have already created in an access?

I don't understand.
I was thinking of running this excel macro in an Access Macro. Is there a
function such as "TransferSpreadsheet" or the like that would run this Excel
Macro?

The macro that I have created in Excel essentially opens spreadsheet "A",
formats data in spreadsheet "A", then saves as spreadsheet "B".

Untested:
Set objExcel = CreateObject("Excel.Application")
objExcel.Run("d:\path\workbook.xl!xlmacro")
objExcel.Quit

It may need
objExcel.Workbooks.Open("d:\path\workbook.xl!xlmacro")
as 2nd statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top