Open an Excel XP workbook from Access XP

  • Thread starter Thread starter Scorpiorc
  • Start date Start date
S

Scorpiorc

Can someone tell me how I can have Access open up an
Excel file? I want to create a button on a switchboard
that the user can push and it will automatically open a
certain Excel file. I've tried many things, but just
can't seem to get this to work.

Thank you
 
Step 1. Create an instance of Excel e.g.
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")

Step 2. Open the Workbook e.g.
Dim xlBook As Excel.Workbook
Set xlBook = xlApp.Workbooks.Open "path and filename of
workbook"

Hope This Helps
Gerald Stanley MCSD
 
Hi Scorp,

One way is to put a function like this in a module in your database:

Public Function OpenMyWorkbook()
FollowHyperlink "D:\folder\subfolder\workbook.xls"
End Function

and then create a switchboard item to "run code" .
 
Back
Top