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
 

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

Back
Top