ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shell Function - Syntax (https://www.excelbanter.com/excel-programming/340035-shell-function-syntax.html)

bill_morgan

Shell Function - Syntax
 
Hi All,

VBA Shell() - Excel 2000

I am trying to use Shell() to execute a DOS command but keep getting a "File
Not Found" (Run-Time Error 53) error.

Following is a simple example. What am I doing wrong? Thanks.

Dim MyID as Integer
MyID = Shell("Format A:")

bill m






Gary''s Student

Shell Function - Syntax
 
ID = Shell("command.com /c format a:")

but you will still have to communicate with the format program
--
Gary''s Student


"bill_morgan" wrote:

Hi All,

VBA Shell() - Excel 2000

I am trying to use Shell() to execute a DOS command but keep getting a "File
Not Found" (Run-Time Error 53) error.

Following is a simple example. What am I doing wrong? Thanks.

Dim MyID as Integer
MyID = Shell("Format A:")

bill m






bill_morgan

Shell Function - Syntax
 
Work perfectly. Thank you ...

"Gary''s Student" wrote:

ID = Shell("command.com /c format a:")

but you will still have to communicate with the format program
--
Gary''s Student


"bill_morgan" wrote:

Hi All,

VBA Shell() - Excel 2000

I am trying to use Shell() to execute a DOS command but keep getting a "File
Not Found" (Run-Time Error 53) error.

Following is a simple example. What am I doing wrong? Thanks.

Dim MyID as Integer
MyID = Shell("Format A:")

bill m







All times are GMT +1. The time now is 08:57 PM.

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