![]() |
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! |
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! |
Delete a workbook...
OMG man!!! YOU ROCK!!! |
All times are GMT +1. The time now is 04:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com