Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete a workbook.
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete a workbook.
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" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete a workbook.
Chip:
Thanks..works like a charm! John |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete a workbook.
Command to delete a file is: Kill ThisFileName where ThisFileName is the complete path ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to delete all named ranges in a workbook en masse? | Excel Discussion (Misc queries) | |||
How do I delete a macro when the workbook has been deleated? | New Users to Excel | |||
Macro to delete workbook after use | Excel Discussion (Misc queries) | |||
Delete a workbook while in a macro | Excel Worksheet Functions | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) |