View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Wiss Don Wiss is offline
external usenet poster
 
Posts: 300
Default Issuing DOS command in VBA macro?

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.