OPenign an Excel sheet form Access

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

Daniel Pineault

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

Amanda

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

Douglas J. Steele

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
 
L

Lance

Private Sub Command2_Click()
Application.FollowHyperlink ("C:\Book1.XLS")
End Sub
 
Top