Command button to open EXCEL path

  • Thread starter Thread starter dab1477
  • Start date Start date
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.
 
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.
 
Back
Top