Discussion:
convert VBS line to VBA
(too old to reply)
g***@pnmac.com
2018-04-27 13:46:37 UTC
Permalink
Hi.

I have the following in VBS:
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs


I thought these 2 lines in VBA would do the same thing, but I am getting error:

ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"

Shell "wscript ""N:\TEST\TEST.vbs""


How can I convert that VBS code to Excel VBA?

Thanks
g***@pnmac.com
2018-04-27 13:48:14 UTC
Permalink
Post by g***@pnmac.com
Hi.
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs
ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"
Shell "wscript ""N:\TEST\TEST.vbs""
How can I convert that VBS code to Excel VBA?
Thanks
hi. actually, that is a .BAT line, not VBS. how can I convert that .BAT line to excel VBA?
g***@pnmac.com
2018-04-27 14:14:49 UTC
Permalink
Post by g***@pnmac.com
Hi.
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs
ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"
Shell "wscript ""N:\TEST\TEST.vbs""
How can I convert that VBS code to Excel VBA?
Thanks
nevermind. figured it out.
Auric__
2018-04-27 14:43:32 UTC
Permalink
Post by g***@pnmac.com
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs
ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"
Shell "wscript ""N:\TEST\TEST.vbs""
How can I convert that VBS code to Excel VBA?
I've got to wonder, why is your batch calling wscript from a server? Is there
a policy preventing you from running the local copy?
--
los flores pequeno de muerte (the little flowers of death)
JJ
2018-04-27 20:01:30 UTC
Permalink
Post by Auric__
Post by g***@pnmac.com
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs
ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"
Shell "wscript ""N:\TEST\TEST.vbs""
How can I convert that VBS code to Excel VBA?
I've got to wonder, why is your batch calling wscript from a server? Is there
a policy preventing you from running the local copy?
What he asked, never agree with what his code does.
g***@pnmac.com
2018-05-02 14:18:46 UTC
Permalink
Post by g***@pnmac.com
Hi.
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe N:\TEST\TEST.vbs
ChDir "\\site.com\srvr\Applications\SUB2\SUB3\FLDR\FLDR2\FLDR3\Bin"
Shell "wscript ""N:\TEST\TEST.vbs""
How can I convert that VBS code to Excel VBA?
Thanks
hi. its only because i am trying to let other people run the code from their machine. and the software i have on my machine is not on theirs. but there are DLL files i places on the LAN.
Wendelin Uez
2018-05-30 18:11:37 UTC
Permalink
Hi Gerald,

simply create a .bat file RUNTEST.bat in N:\TEST with one single command
\\site.com\srvr\Applications\SUB2\SUB3\FLDR\SysWOW64\wscript.exe
N:\TEST\TEST.vbs
and excute this .bat file in a VBA script with
CALL SHELL ("N:\TEST\RUNTEST.bat",1)
or eventually shorter with SHELL "N:\TEST\RUNTEST.bat",1 what should also
work (maybe this syntax requires a semicolon instead of a comma).

HTH,
wuez

Continue reading on narkive:
Loading...