OPenign an Excel sheet form Access

  • Thread starter Thread starter Amanda
  • Start date Start date
A

Amanda

Hello everyone,

I would like to open a shared excel spreadsheet on our server by using a
button from Access. Can I use the runApp macro for this? If so what do I
need to do...I have little experience with macros.

Thanks.
 
Add a button to your form
add an onclick event and then enter the following code

application.followhyperlink "c:\...\...\...\excel.xls"


obviously replace the "c:\...\...\...\excel.xls" with the path and filename
of the excel file you wish to open.
 
Thanks for the information but I can't quite seem to get it to work...do I
write the "application.followhyperlink "c:\...\...\...\excel.xls"" right in
the box beside on click event or do I have to put it in the actual code? I
have never done anything with code before so I am not sure how to do that.
 
You have to put it into code.

Go to your Click event and select [Event Procedure] from the combo and click
on the ellipsis (...) to the right of that. That'll take you into the VB
Editor, in the middle of something like:

Private Sub NameOfButton_Click

End Sub

Put that code in the middle, so that you end up with:

Private Sub NameOfButton_Click

Application.FollowHyperlink "c:\...\...\...\excel.xls"

End Sub
 

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