Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 284
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
translate lotus 1-2-3 macro into excel macro using excel 2000 krutledge0209 Excel Programming 1 November 2nd 04 05:50 PM


All times are GMT +1. The time now is 08:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"