Open an Excel file using macro

  • Thread starter Thread starter Imran J Khan
  • Start date Start date
I

Imran J Khan

I have an excel file that uses data from my access database.

I have a macro in my database that filters and updates the table that the
excel file uses. I would like to the macro to open the excel file after it
has done the updating and filtering of the table. I tried to use the RUNAPP
option, but I don't know what command line to use and also how the file path
would fit into the command line.

Thanks in advance
 
I would use Automation:

Dim xls As Object
Dim wbk As Object
Set xls = CreateObject("Excel.Application")
Set wbk = xls.Workbooks.Open("C:\MyFolder\MyEXCELfilename.xls")


Will the ACCESS database close itselft after it's opened the EXCEL file, or
will it remain open?
 
If you don't want to use VBA Automation, then your command line in a RunApp
macro would look like this:

EXCEL.exe "C:\My Folder\My EXCEL file name.xls"
 
Back
Top