open excel file through access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a form in microsoft access with buttons used to open tables and run
simple queries. I would like to add buttons that would open specific word
and excel files.

excel and word are located on a local hard drive, while the files i would
like to open are on a network drive.

what do i have to do so that all you have to do is click a button in an
access form to have a word or excel file open
 
It depends on what you want to do once you open the files. If you just want
to launch the app from Access, then see the Shell statement in Access Help.
If you want to manipulate them from within Access, here is a sample of
opening an Excel file:

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open _
("C:\Documents and Settings\hargida\My Documents\SELRec_ITM-PM YTD
ApriL2005.xls")
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Activate
 
You can simply use the FollowHyperlink Mehod in the CommandButton_Click
Event.

Check Access VB Help on FollowHyperlink.
 
That is fine if you have a Hyperlink defined for the file. I did not see in
the original post that there is one.
 
All you have to do is to stick "file:" in front of the full-path and you get
the required hyperlink.
 

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

Back
Top