Thread: DOS batch files
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Clif McIrvin[_3_] Clif McIrvin[_3_] is offline
external usenet poster
 
Posts: 203
Default DOS batch files

"Robert Crandal" wrote in message
...
"Clif McIrvin" wrote in message
...

Does the workbook in question actually need to be closed for the
operations to take place, or are the operations happening to a
different file?

If a different file, put the VBA code in the Workbook.Close event.

If the same file, post back and either myself or someone else can
help you design code that will run after your workbook has finished
exiting.


Basically, I need to put VBA code in Workbook.Close() that
deletes a file on the C: drive named "orders.txt". Then I need
to create a new replacement file named "orders.txt" which I
will write my own data into.



There are different tools available for doing this in VBA. I'm not at
all familiar with the FileSystem Object, but I did use the BASIC
statements such as OPEN, KILL, etc. years ago; and they are still
available in VBA.

Check the Visual Basic Language Reference in your on-board help for
syntax.

I don't have sample code at hand, but could throw together some air code
if you need it.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)