Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Macro to delete a workbook.

Chip:

Thanks..works like a charm!

John
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to delete all named ranges in a workbook en masse? Dave F Excel Discussion (Misc queries) 1 November 3rd 06 09:17 PM
How do I delete a macro when the workbook has been deleated? Sunshine1 New Users to Excel 1 August 24th 06 08:42 PM
Macro to delete workbook after use Nigel Excel Discussion (Misc queries) 1 June 22nd 06 08:49 PM
Delete a workbook while in a macro jthurnwps Excel Worksheet Functions 1 March 10th 06 09:22 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM


All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"