Issuing DOS command in VBA macro?
Use Shell:
Shell "command.com /c DIR c:\*.* Temp.prn"
--
Jim Rech
Excel MVP
"Don Wiss" wrote in message
...
| To read files from my hard disk into a spreadsheet I run a batch file
like:
|
| dir "G:\My Music\Comedy\*.*" c:\temp.prn
| pause
|
| dir "G:\My Music\Compilations\*.*" c:\temp.prn
| pause
|
| dir "G:\My Music\Country\*.*" c:\temp.prn
| pause
|
| Then at each pause I change the focus to the spreadsheet and type Ctrl-H,
| which runs the import macro. It would simplify things greatly if I could
| issue the commands in a macro and have all run in one step. I know issuing
| a command is easy in regular programming languages. What is involved to do
| so in VBA? (I'm using Excel 2002.)
|
| Don <donwiss at panix.com.
|