Command button to open EXCEL path

D

dab1477

How do I code a command button to open a specific EXCEL sheet or file located
in a specific location each time I click the command button? Is this
possible? I understand that I can output to EXCEL, but in this case, I only
wish to open then print an EXCEL file. This file acts as a data collection
form. It was too cumbersome to create in Access. I'm hoping to be able to
print the from from the Access database switchboard that is accepting the
manual data input from the file. Thank in advance for the assist.
 
K

Ken Snell \(MVP\)

Private Sub CommandButton_Click()
Application.FollowHyperlink "C:\MyFolder\MyFile.xls"
End Sub

Above example will open the MyFile.xls file located in the C:\MyFolder\
folder. You can replace the string with a variable or constant that contains
the full path and file name.
 

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