PC Review


Reply
Thread Tools Rate Thread

Delete workbook

 
 
Ed
Guest
Posts: n/a
 
      10th Jun 2009
I have a macro which has copied data from a workbook, I now want the macro
to delete the entire workbook (send it to the recycle bin) but can't figure
out how to do it. Can someone please help me with this problem.


 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      10th Jun 2009
KILL "path"

"Ed" <(E-Mail Removed)> wrote in message
news:vFOXl.33431$(E-Mail Removed)...
> I have a macro which has copied data from a workbook, I now want the macro
> to delete the entire workbook (send it to the recycle bin) but can't
> figure out how to do it. Can someone please help me with this problem.
>

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      10th Jun 2009
Just so the OP knows, Kill doesn't send the file to the Recycle Bin (as the
OP indicated he wanted)... it permanently removes the file from the drive.

--
Rick (MVP - Excel)


"Patrick Molloy" <(E-Mail Removed)> wrote in message
news:CCB3F6F0-FC10-4D09-BB71-(E-Mail Removed)...
> KILL "path"
>
> "Ed" <(E-Mail Removed)> wrote in message
> news:vFOXl.33431$(E-Mail Removed)...
>> I have a macro which has copied data from a workbook, I now want the
>> macro to delete the entire workbook (send it to the recycle bin) but
>> can't figure out how to do it. Can someone please help me with this
>> problem.
>>


 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      10th Jun 2009
If the OP wants to use the Recycle Bin, there is an API solution to do so.
There is an example of how to do this here...

http://vbnet.mvps.org/code/shell/recyclebin.htm

If the OP needs help breaking this apart for his own needs, he should post
back to this thread and someone here will assist him.

--
Rick (MVP - Excel)


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:%23$(E-Mail Removed)...
> Just so the OP knows, Kill doesn't send the file to the Recycle Bin (as
> the OP indicated he wanted)... it permanently removes the file from the
> drive.
>
> --
> Rick (MVP - Excel)
>
>
> "Patrick Molloy" <(E-Mail Removed)> wrote in message
> news:CCB3F6F0-FC10-4D09-BB71-(E-Mail Removed)...
>> KILL "path"
>>
>> "Ed" <(E-Mail Removed)> wrote in message
>> news:vFOXl.33431$(E-Mail Removed)...
>>> I have a macro which has copied data from a workbook, I now want the
>>> macro to delete the entire workbook (send it to the recycle bin) but
>>> can't figure out how to do it. Can someone please help me with this
>>> problem.
>>>

>


 
Reply With Quote
 
Ed
Guest
Posts: n/a
 
      10th Jun 2009
Thanks Patrick, it works great.


"Patrick Molloy" <(E-Mail Removed)> wrote in message
news:CCB3F6F0-FC10-4D09-BB71-(E-Mail Removed)...
> KILL "path"
>
> "Ed" <(E-Mail Removed)> wrote in message
> news:vFOXl.33431$(E-Mail Removed)...
>> I have a macro which has copied data from a workbook, I now want the
>> macro to delete the entire workbook (send it to the recycle bin) but
>> can't figure out how to do it. Can someone please help me with this
>> problem.
>>



 
Reply With Quote
 
Ed
Guest
Posts: n/a
 
      10th Jun 2009
Thanks Guys - I don't really care what happens to the file. Appreciate all
your help - working fine.


"Rick Rothstein" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If the OP wants to use the Recycle Bin, there is an API solution to do so.
> There is an example of how to do this here...
>
> http://vbnet.mvps.org/code/shell/recyclebin.htm
>
> If the OP needs help breaking this apart for his own needs, he should post
> back to this thread and someone here will assist him.
>
> --
> Rick (MVP - Excel)
>
>
> "Rick Rothstein" <(E-Mail Removed)> wrote in message
> news:%23$(E-Mail Removed)...
>> Just so the OP knows, Kill doesn't send the file to the Recycle Bin (as
>> the OP indicated he wanted)... it permanently removes the file from the
>> drive.
>>
>> --
>> Rick (MVP - Excel)
>>
>>
>> "Patrick Molloy" <(E-Mail Removed)> wrote in message
>> news:CCB3F6F0-FC10-4D09-BB71-(E-Mail Removed)...
>>> KILL "path"
>>>
>>> "Ed" <(E-Mail Removed)> wrote in message
>>> news:vFOXl.33431$(E-Mail Removed)...
>>>> I have a macro which has copied data from a workbook, I now want the
>>>> macro to delete the entire workbook (send it to the recycle bin) but
>>>> can't figure out how to do it. Can someone please help me with this
>>>> problem.
>>>>

>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete one of the following[workbook]:1 and [workbook]:2 Boston Jerry Microsoft Excel Misc 3 23rd Oct 2009 04:56 PM
Save workbook and delete old workbook fee Microsoft Excel Programming 3 12th Mar 2008 02:13 PM
delete workbook from one location and save workbook to new locatio =?Utf-8?B?RGFtaWVu?= Microsoft Excel Programming 5 3rd Aug 2006 03:05 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) resant_v@yahoo.com Microsoft Excel Misc 1 8th Mar 2006 10:10 AM
re: Automatically Delete WorkBook 2 modules by using Workbook 1 module =?Utf-8?B?ZGRpaWNj?= Microsoft Excel Programming 5 27th Jul 2005 12:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:15 PM.