Open an Excel file using macro

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
 
K

Ken Snell \(MVP\)

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?
 
K

Ken Snell \(MVP\)

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"
 

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