Invalid procedure call or argument

A

adsl

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)
 
A

adsl

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
 
A

adsl

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
 
A

adsl

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
 

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

Top