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.
--
Ken Snell <MS ACCESS MVP> http://www.accessmvp.com/KDSnell/
"dab1477" <dab1477[ at ]discussions.microsoft.com> wrote in message news:DB7E0388-9950-42FB-923A-8417947C0276[ at ]microsoft.com...
[Quoted Text] > 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. >
|