Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default has anybody come across this before?


this is just an example i am using to point out, i am trying to open command
prompt, and run something in it from vba.

Private Sub cmd1_Click()
Dim OldPath As String
Dim NewPath As String
a = 13048
b = " VQRUN" & " " & a & ".prn" & " " & a & ".out"
'vqrun is the name of the program that i wanted to run in command prompt
'and 13048.prn and 13048.out are the parameters passed to the application
vqrun.

OldPath = CurDir
NewPath = "C:\VQ80_2\ "
ChDrive NewPath
ChDir NewPath


', now, it opens the cmd prompt with the new path, which is fine(c:\vq80_2),
but now i need to run 'vqrun along wit the parameters'.

i know that the below line is wrong because i cannot simply add 'b', but is
there anyway i could do this?
ret = Shell("c:\winnt\system32\cmd.exe", b)


anyhelp on this is much much appreciated because i have been waiting for the
answer of this question for a long time. cheers.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default has anybody come across this before?

Jason,

See my reply in Worksheetfunctions, and please don't cross post - it wastes time and effort.

Bernie
MS Excel MVP


"Jason" wrote in message
...

this is just an example i am using to point out, i am trying to open command
prompt, and run something in it from vba.

Private Sub cmd1_Click()
Dim OldPath As String
Dim NewPath As String
a = 13048
b = " VQRUN" & " " & a & ".prn" & " " & a & ".out"
'vqrun is the name of the program that i wanted to run in command prompt
'and 13048.prn and 13048.out are the parameters passed to the application
vqrun.

OldPath = CurDir
NewPath = "C:\VQ80_2\ "
ChDrive NewPath
ChDir NewPath


', now, it opens the cmd prompt with the new path, which is fine(c:\vq80_2),
but now i need to run 'vqrun along wit the parameters'.

i know that the below line is wrong because i cannot simply add 'b', but is
there anyway i could do this?
ret = Shell("c:\winnt\system32\cmd.exe", b)


anyhelp on this is much much appreciated because i have been waiting for the
answer of this question for a long time. cheers.



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



All times are GMT +1. The time now is 07:09 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"