Open an Excel XP workbook from Access XP

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
 
G

Gerald Stanley

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
 
J

John Nurick

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" .
 

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