Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 25
Default Run external program.

Hello,

I have this macro (I'am trying remove all " from some txt file):

Set objshell = CreateObject("WScript.Shell")
objshell.Run "%comspec% /c gsar.exe -s"""""" -r -o ""C:\Program
Files\Test\test.txt""", 1, True

gsar.exe is in c:\windows and it works, but when I edit this macro like
that:

Set objshell = CreateObject("WScript.Shell")
GsarPath = "gsar.exe is ingsar.exe"
objshell.Run "%comspec% /c """ & GsarPath & """ -s"""""" -r -o
""C:\Program Files\Test\test.txt""", 0, True

gsar.exe is in gsar.exe is in, it dosnt work.

Can you help me?
Thanks
Tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run external program.

Seems like you should get something running that has spaces in the name like
GsarPath does. Then you can substitute in a variable in the string. What
you have now produces pretty much what works except it puts double quotes
around the gsar.exe is ingsar.exe where in your original, gsar.exe has no
quotes around it. Maybe you need single quotes rather than double quotes.
I can't say.

--
Regards,
Tom Ogilvy


"Tom" wrote in message
...
Hello,

I have this macro (I'am trying remove all " from some txt file):

Set objshell = CreateObject("WScript.Shell")
objshell.Run "%comspec% /c gsar.exe -s"""""" -r -o ""C:\Program
Files\Test\test.txt""", 1, True

gsar.exe is in c:\windows and it works, but when I edit this macro like
that:

Set objshell = CreateObject("WScript.Shell")
GsarPath = "gsar.exe is ingsar.exe"
objshell.Run "%comspec% /c """ & GsarPath & """ -s"""""" -r -o
""C:\Program Files\Test\test.txt""", 0, True

gsar.exe is in gsar.exe is in, it dosnt work.

Can you help me?
Thanks
Tom




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
how to pass a cell as parameter for an external program? maxbell Excel Discussion (Misc queries) 1 February 8th 07 10:40 AM
Copying data to an external Program Debby Bunce New Users to Excel 1 June 9th 05 12:31 AM
Can I run an external program? [email protected] Excel Programming 17 December 7th 04 11:23 PM
How do I run an external program? Phillips Excel Programming 1 November 25th 03 05:23 PM
Open external program bondy Excel Programming 1 October 22nd 03 01:57 PM


All times are GMT +1. The time now is 07:42 PM.

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"