Calling Excel macros from within Access

purceld2

Registered User.
Local time
Today, 02:00
Joined
Dec 4, 2008
Messages
79
Is it possible to call a Excel macro from within Access? I export an Excel spreadsheet then manually run a Excel macro on the spreadsheet I was just wionering if it call could be done within Access

thank you in advance

regards

Desmond
 
I don't have any experience doing it, but I had some code snippets in my notebook, so I tried to put something together for you (add a reference to Microsoft Excel at Tools > References).

Dim xlapp As New Excel.Application
Dim wb As Excel.Workbook
Set wb = xlapp.Workbooks.Open("C:\Book1.xls")
wb.Application.Run ("Macro1")
wb.Save
wb.Close
xlapp.Quit
Set xlapp = Nothing
 
Last edited:

Users who are viewing this thread

Back
Top Bottom