Macro to delete a workbook.

  • Thread starter Thread starter John Baker
  • Start date Start date
J

John Baker

Hi:

I need to save some data in a special workbook, save the workbook (with a new name), then
e mail the workbook and delete the saved workbook.

I can do all this except the last step.

I want to delete the saved workbook (which is not the one containing the macro) with no
question or message to the end user.

Anyone know of a method?

Regards

John Baker
 
John,

You can use the Kill statement to permanently delete a file. For
example,

Kill "C:\Test\Book1.xls"

Note that Kill does not put the file in the Recycle Bin. To
delete a file to the Recycle Bin, see
www.cpearson.com/excel/recycle.htm .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

John Baker said:
Hi:

I need to save some data in a special workbook, save the
workbook (with a new name), then
 
Back
Top