Re: Run a *.vbs file from MS-Access or MS-Excel by mr_unreliable
mr_unreliable
Wed Apr 04 13:25:15 CDT 2007
xp, is there a "blank" (character) in either the path
or the filename?
cheers, jw
XP wrote:
> That is what I thought, but when I use the Shell method in MS-Access I get
> error:
>
> Invalid procedure call or argument
>
> Any idea what's going on here?
>
> The path and file name are solid...and outside of that it doesn't seem there
> is too much that could go wrong...but I'm getting the error; I could actually
> open it using the FollowHyperlink method but this opens an unsupressable
> warning message so I don't like that...how can I get shell to work?
>
> "mr_unreliable" wrote:
>
>> hi XP,
>>
>> Try the "shell" function.
>>
>> Go to the "tools" => "visual basic editor" and write yourself
>> a macro, having the shell function which will run your script.
>>
>> Like this:
>>
>> Call Shell("myPath\myScript.vbs myArguments")
>>
>> To get the macro to run, you are going to have to hook it to
>> a command button, place it in an "Auto" type macro, or some
>> other event to initiate your macro.
>>
>> cheers, jw
>> ____________________________________________________________
>>
>> You got questions? WE GOT ANSWERS!!! ..(but,
>> no guarantee the answers will be applicable to the questions)
>>
>>
>>
>> XP wrote:
>>> Using Office 2003 and Windows XP;
>>>
>>> Could someone please post generic example code that illustrates how to run a
>>> stand alone *.vbs file from MS-Access and/or MS-Excel (I would presume the
>>> same method would work for either)?
>>>
>>> Thanks much in advance.