open application to a specific doc with a cmd button

  • Thread starter Thread starter mgm
  • Start date Start date
M

mgm

I would like to open an excel worksheet from an access form.. this is what
I've tried but it doesn't find the doc. This worked with access 97, but not
with 2000. Any help would be appreciated.

Private Sub Command25_Click()

Dim myApp As String
Dim myDoc As String

myApp = "excel.exe "
myDoc = "workflow.xls"
Shell myApp & myDoc, vbNormalFocus
 
Another alternative is to simply use Application.FollowHyperlink. It will
open any document (including excel workbooks) in the default application
associated with the document.

Application.FollowHyperlink Path&Filename
Application.FollowHyperlink "c:\workflow.xls" 'Use your fullpath
 
Back
Top