A
Ian Davies said:Doug
Using the code as it was worked
Thanks
and thanks to
Dev Ashish
Douglas J. Steele said:I use it in VBA all the time.
Copy all of the code in the sample into a new module. Don't name the
module the same as the function (in other words, don't name the module
fHandleFile: use something like mdlShellExecute or mdlHandleField)
Ian Davies said:Thanks for your post
Ive checked out the link. It seems the ShellExecute can only be used in
visual basic. Ive tried it in my VBA code but it seems Access doesnt
recognise it.
Ian
Douglas J. Steele said:I don't believe Shell works with extensions other than .exe (although I
believe you might be able to use the Start keyword)
Take a look at using the ShellExecute API call instead. There's a complete
example at http://www.mvps.org/access/api/api0018.htm at "The Access Web"
Douglas J. Steele said:I don't believe Shell works with extensions other than .exe (although I
believe you might be able to use the Start keyword)
Take a look at using the ShellExecute API call instead. There's a complete
example at http://www.mvps.org/access/api/api0018.htm at "The Access Web"
Ian Davies said:Hello
Im trying to get the path of my Access application and use it to open the
userguide help file (which resides in the same folder). I am getting the
error message 'Invalid procedure call or argument'
My code is below. Can anyone tell me if I am going about this the right
way.
Private Sub Label47_Click()
Dim RetVal As Variant
On Error GoTo Inst_Error
RetVal = Shell(Application.CurrentProject.Path & "\UserGuide.chm", 1)
If RetVal = 0 Then
GoTo Inst_Error
Exit Sub
Inst_Error:
MsgBox "Installer was unable to open the user guide." & Chr(10) & Chr(13)
&
"The file may be corrupt or not in the same folder as the application" &
Chr(10) & Chr(13) & Chr(13) & "Error " & Err.Number & " : " &
Err.Description
End Sub
Douglas J. Steele said:I don't believe Shell works with extensions other than .exe (although I
believe you might be able to use the Start keyword)
Take a look at using the ShellExecute API call instead. There's a complete
example at http://www.mvps.org/access/api/api0018.htm at "The Access Web"
Douglas J. Steele said:I don't believe Shell works with extensions other than .exe (although I
believe you might be able to use the Start keyword)
Take a look at using the ShellExecute API call instead. There's a complete
example at http://www.mvps.org/access/api/api0018.htm at "The Access Web"
Ian Davies said:Hello
Im trying to get the path of my Access application and use it to open the
userguide help file (which resides in the same folder). I am getting the
error message 'Invalid procedure call or argument'
My code is below. Can anyone tell me if I am going about this the right
way.
Private Sub Label47_Click()
Dim RetVal As Variant
On Error GoTo Inst_Error
RetVal = Shell(Application.CurrentProject.Path & "\UserGuide.chm", 1)
If RetVal = 0 Then
GoTo Inst_Error
Exit Sub
Inst_Error:
MsgBox "Installer was unable to open the user guide." & Chr(10) & Chr(13)
&
"The file may be corrupt or not in the same folder as the application" &
Chr(10) & Chr(13) & Chr(13) & "Error " & Err.Number & " : " &
Err.Description
End Sub
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.