Run vbscript from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a vbscript I need to run from Access. I tried to use RunApp with the
fullpath of the script in the command line box in Macro. It does not work and
I don't know what the correct way is. Anyone can give me some advice?
Thanks.
cdb
 
iampritzy said:
I have a vbscript I need to run from Access. I tried to use RunApp
with the fullpath of the script in the command line box in Macro. It
does not work and I don't know what the correct way is. Anyone can
give me some advice? Thanks.
cdb

You can use the VBA code, like this:

Application.FollowHyperlink "C:\Path To\YourScript.vbs"

In my experience, that opens a confirmation dialog first, warning you
that proceeding could be harmful. But if you click OK, the script will
be run.

You can avoid the confirmation dialog by using the fHandleFile function
posted here:

http://www.mvps.org/access/api/api0018.htm
API: Start an app with ShellExecute

But that solution is a bit more code-heavy than the first one.
 
Back
Top