ATTN: Tom Ogilvy or anyone else: send DOS command?

Q

quartz

I am using Office 2003 on Windows XP.

I want to send the following DOS command through VBA in Excel:

copy a.htm + b.htm + c.htm d.htm

This command should append a, b, c to a new file d.

Can Tom (or someone who knows) please post example code showing the correct
syntax to run this command? I'm assuming it has to be Shell-ed out.

These files reside on a network share like:

\\fs5\finance\corporate accounting\a.htm

Thanks in advance for your assistance.
 
P

Patrick Molloy

open "c:\temp.bat" for output as #1
write #1."copy a.htm + b.htm + c.htm d.htm"
close
shell "C:\Temp.bat"
 
Q

quartz

Thanks Patrick.

I copied the files to C:\ and renamed them with short names (e.g.
XLHTM1.htm, XLHTM2.htm, etc.). Running the code you suggested executes
without error, but fails to do anything.

i.e. No combined file is generated...what am I doing wrong?
 
D

Dave Peterson

See one more response at your other thread.
I am using Office 2003 on Windows XP.

I want to send the following DOS command through VBA in Excel:

copy a.htm + b.htm + c.htm d.htm

This command should append a, b, c to a new file d.

Can Tom (or someone who knows) please post example code showing the correct
syntax to run this command? I'm assuming it has to be Shell-ed out.

These files reside on a network share like:

\\fs5\finance\corporate accounting\a.htm

Thanks in advance for your assistance.
 
Q

quartz

Thanks to all who responded, you guys really nailed it forme. It works great
and is EXACTLY what I needed. Thanks a lot!
 

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

Top