Running Excel Macros in Access 2002

  • Thread starter Thread starter RS
  • Start date Start date
R

RS

I have some macros that works well in Excel. I have Access
reports that pulls from the Excel file successfully. I
would like to use my main Access application to run the
macro in Excel prior to running my reports. Can anyone
assist?
 
Dim XL as Object

Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open "C:\Folder\spreadsheet.xls" 'you'll need to set the path
and filename here
XL.Run "Macro name"

'Then be sure to destroy the objects
XL.Quit
Set XL = Nothing
 
Back
Top