Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Delete a workbook...

I have a spreadsheet that a user fills out. We'll call it GAB.
1030.xls. The user fills out some fields and clicks a button "Save &
Send". This workbook is then copied and sent to another user. The
new user opens GAB.1030.xls and gets some information. The button now
reads "Done & Delete". When clicked, I want line B1 to be copied to
an archive workbook (called "archive.xls") and then I want GAB.
1030.xls to be deleted. I know that I can just copy B1 and stick it
in an email to this person, but that's not what my company wants.

I'm thinking when archive.xls is opened to paste line B1, that GAB.
1030.xls could be closed and then archive.xls could have the macro to
delete GAB.1030.xls??

Any ideas?

Oh, and I just wanted to say that I really appreciate all the advice I
get from this group. You all have saved my @$$ on more than one
occasion - big props!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete a workbook...

Hi

You can use code like this to copy to archive.xls in GAB.1030.xls
http://www.rondebruin.nl/copy1.htm
(See "What if the Database sheet is in another workbook")

Then you can use this to delete file in the same macro

With ThisWorkbook
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


wrote in message ...
I have a spreadsheet that a user fills out. We'll call it GAB.
1030.xls. The user fills out some fields and clicks a button "Save &
Send". This workbook is then copied and sent to another user. The
new user opens GAB.1030.xls and gets some information. The button now
reads "Done & Delete". When clicked, I want line B1 to be copied to
an archive workbook (called "archive.xls") and then I want GAB.
1030.xls to be deleted. I know that I can just copy B1 and stick it
in an email to this person, but that's not what my company wants.

I'm thinking when archive.xls is opened to paste line B1, that GAB.
1030.xls could be closed and then archive.xls could have the macro to
delete GAB.1030.xls??

Any ideas?

Oh, and I just wanted to say that I really appreciate all the advice I
get from this group. You all have saved my @$$ on more than one
occasion - big props!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Delete a workbook...



OMG man!!! YOU ROCK!!!
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
Delete workbook..? Ron de Bruin Excel Programming 1 December 28th 06 06:25 AM
delete workbook from one location and save workbook to new locatio Damien Excel Programming 5 August 3rd 06 03:05 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
Delete row if value in another workbook d4m Excel Programming 2 December 20th 05 04:36 PM
Automatically Delete WorkBook 2 modules by using Workbook 1 module ddiicc Excel Programming 5 July 27th 05 12:53 PM


All times are GMT +1. The time now is 06:03 AM.

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

About Us

"It's about Microsoft Excel"