ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run .vbs from a Excel macro? (https://www.excelbanter.com/excel-programming/345665-run-vbs-excel-macro.html)

SpeeD

Run .vbs from a Excel macro?
 
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the script opens
phostoshop, does several actions, makes some files... and closes..)

How can i do this??

Thnks a lot!!
SpeeD

Tom Ogilvy

Run .vbs from a Excel macro?
 
Use the shell command. See excel vba help for details.

--
Regards,
Tom Ogilvy



"SpeeD" wrote in message
...
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the script opens
phostoshop, does several actions, makes some files... and closes..)

How can i do this??

Thnks a lot!!
SpeeD




SpeeD

Run .vbs from a Excel macro?
 
Thanks Tom!

I´ll do that!

SpeeD72

"Tom Ogilvy" wrote:

Use the shell command. See excel vba help for details.

--
Regards,
Tom Ogilvy



"SpeeD" wrote in message
...
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the script opens
phostoshop, does several actions, makes some files... and closes..)

How can i do this??

Thnks a lot!!
SpeeD





SpeeD

Run .vbs from a Excel macro?
 
hi again!

The command works fine with an EXE, but give an "invalid preocedure" with my
test.vbs file.
Is there a way to go round this problem?

Thanks
SpeeD72


"Tom Ogilvy" wrote:

Use the shell command. See excel vba help for details.

--
Regards,
Tom Ogilvy



"SpeeD" wrote in message
...
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the script opens
phostoshop, does several actions, makes some files... and closes..)

How can i do this??

Thnks a lot!!
SpeeD





Chip Pearson

Run .vbs from a Excel macro?
 
Post your code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"SpeeD" wrote in message
...
hi again!

The command works fine with an EXE, but give an "invalid
preocedure" with my
test.vbs file.
Is there a way to go round this problem?

Thanks
SpeeD72


"Tom Ogilvy" wrote:

Use the shell command. See excel vba help for details.

--
Regards,
Tom Ogilvy



"SpeeD" wrote in message
...
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the
script opens
phostoshop, does several actions, makes some files... and
closes..)

How can i do this??

Thnks a lot!!
SpeeD







Steve Yandl

Run .vbs from a Excel macro?
 
The executable for running scripts is either Wscript.exe or Cscript.exe,
both located in the system32 folder. Something like:

Sub RunAscript()
Dim RetVal
RetVal = Shell("C:\Windows\System32\WScript.exe C:\Test\myScript.vbs", 0)
End Sub

would run the script "C:\Test\myScript.vbs" using Shell.

I think I'd create an instance of the Scripting Runtime in Excel and just
incorporate the code from the script inside the VBA routine rather than
launch a separate script. If you use Shell, you can't be sure that the
script will have finished what it's supposed to do before the rest of your
code runs.

Steve


"SpeeD" wrote in message
...
hi again!

The command works fine with an EXE, but give an "invalid preocedure" with
my
test.vbs file.
Is there a way to go round this problem?

Thanks
SpeeD72


"Tom Ogilvy" wrote:

Use the shell command. See excel vba help for details.

--
Regards,
Tom Ogilvy



"SpeeD" wrote in message
...
Hi guys!

I need to run a .vbs scrpit from inside a excell macro. (the script
opens
phostoshop, does several actions, makes some files... and closes..)

How can i do this??

Thnks a lot!!
SpeeD








All times are GMT +1. The time now is 06:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com