Run vbscript from Access

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
 
D

Dirk Goldgar

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.
 

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