|
-
Mar 31st, 2003, 01:45 AM
#1
Thread Starter
Frenzied Member
Run-time error '5'
Run-time error '5':
Invalud procedure call or argument
and it shows up for this line:
Code:
x = Shell ("c:\Progra~1\VIH\VIHdata.mdb /x mcrVBSys_ExpMdl", vbNormalFocus)
i am completely stumpted
thanks
Dimava
NXSupport - Your one-stop source for computer help
-
Mar 31st, 2003, 02:13 AM
#2
Member
As the Shell function is only used to run executable programs, you'll have to use the ShellExecute API call.
Code:
Private Declare Function ShellExecute Lib "SHELL32.DLL" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim RetVal As Long
RetVal = ShellExecute(Me.hwnd, "open", "c:\Progra~1\VIH\VIHdata.mdb", "/x mcrVBSys_ExpMdl", "", vbNormalFocus)
End Sub
-
Mar 31st, 2003, 06:30 PM
#3
Thread Starter
Frenzied Member
thanks for the reply, but why is /x mcrVBSys_ExpMdl seperated from the math to the db?
right now it opens the DB, but it doesnt run the macro
thanks,
Dimava
NXSupport - Your one-stop source for computer help
-
Mar 31st, 2003, 09:20 PM
#4
Member
I split that out because of the lpParameters variable. I may be incorrect in thinking that it had to be split out (notice directory does not), so you may be able to put everything in that one string. I am not certain.
-
Mar 31st, 2003, 11:32 PM
#5
Stuck in the 80s
Good ol' Run-time error '5'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|