ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   passing parameters to dos from vba.. (https://www.excelbanter.com/excel-programming/354466-passing-parameters-dos-vba.html)

[email protected]

passing parameters to dos from vba..
 
hi, i am trying to open msdos from vba using shell command, and then to
pass a parameter or a command so that i could change the current
directory and then to run a program..

or is there a way that i could just paste a text in command prompt so
that wtever entered runs when the return key is pressed????


Bernie Deitrick

passing parameters to dos from vba..
 
You don't need to change the directory - you could just use it as part of the shell command string:

Shell "C:\Path\FileName.exe"

Or with parameters:
Shell "C:\Path\FileName.exe /s"

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi, i am trying to open msdos from vba using shell command, and then to
pass a parameter or a command so that i could change the current
directory and then to run a program..

or is there a way that i could just paste a text in command prompt so
that wtever entered runs when the return key is pressed????




rita

passing parameters to dos from vba..
 
On top of opening the command prompt window...
Is it possible to run commands and copy the whole output...

for example,
think there's some script written by others (which i only know how to use)...
command to key = c:\display thisProduct

it will then display a table of information in Dos Mode
subsequently, i'll need to copy the whole table into excel spreadsheet...

This sounds kinda complicated... but that's the best way i can elaborate...
please advice.
Thanks in advance,
Rita


"Bernie Deitrick" wrote:

You don't need to change the directory - you could just use it as part of the shell command string:

Shell "C:\Path\FileName.exe"

Or with parameters:
Shell "C:\Path\FileName.exe /s"

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi, i am trying to open msdos from vba using shell command, and then to
pass a parameter or a command so that i could change the current
directory and then to run a program..

or is there a way that i could just paste a text in command prompt so
that wtever entered runs when the return key is pressed????





Bernie Deitrick

passing parameters to dos from vba..
 
Rita,

You could pipe the output to a file, if your DOS program allows it, then open that file from Excel.
But I don't know of any way to capture the values in a DOS window and import them directly into
Excel.

HTH,
Bernie
MS Excel MVP


"Rita" wrote in message
...
On top of opening the command prompt window...
Is it possible to run commands and copy the whole output...

for example,
think there's some script written by others (which i only know how to use)...
command to key = c:\display thisProduct

it will then display a table of information in Dos Mode
subsequently, i'll need to copy the whole table into excel spreadsheet...

This sounds kinda complicated... but that's the best way i can elaborate...
please advice.
Thanks in advance,
Rita


"Bernie Deitrick" wrote:

You don't need to change the directory - you could just use it as part of the shell command
string:

Shell "C:\Path\FileName.exe"

Or with parameters:
Shell "C:\Path\FileName.exe /s"

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi, i am trying to open msdos from vba using shell command, and then to
pass a parameter or a command so that i could change the current
directory and then to run a program..

or is there a way that i could just paste a text in command prompt so
that wtever entered runs when the return key is pressed????







rita

passing parameters to dos from vba..
 
Thankx!! We'll give your idea a try.



"Bernie Deitrick" wrote:

Rita,

You could pipe the output to a file, if your DOS program allows it, then open that file from Excel.
But I don't know of any way to capture the values in a DOS window and import them directly into
Excel.

HTH,
Bernie
MS Excel MVP


"Rita" wrote in message
...
On top of opening the command prompt window...
Is it possible to run commands and copy the whole output...

for example,
think there's some script written by others (which i only know how to use)...
command to key = c:\display thisProduct

it will then display a table of information in Dos Mode
subsequently, i'll need to copy the whole table into excel spreadsheet...

This sounds kinda complicated... but that's the best way i can elaborate...
please advice.
Thanks in advance,
Rita


"Bernie Deitrick" wrote:

You don't need to change the directory - you could just use it as part of the shell command
string:

Shell "C:\Path\FileName.exe"

Or with parameters:
Shell "C:\Path\FileName.exe /s"

HTH,
Bernie
MS Excel MVP


wrote in message
oups.com...
hi, i am trying to open msdos from vba using shell command, and then to
pass a parameter or a command so that i could change the current
directory and then to run a program..

or is there a way that i could just paste a text in command prompt so
that wtever entered runs when the return key is pressed????









All times are GMT +1. The time now is 01:53 PM.

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