has anybody come across this before?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Jason,

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

Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top