ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting (https://www.excelbanter.com/excel-programming/305037-deleting.html)

Tessa[_2_]

Deleting
 
Is it possible to create a macro that deletes the workbook
it's saved in ?

Chip Pearson

Deleting
 
Tessa,

Try the following code:

With ThisWorkbook
.Saved = True
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close savechanges:=False
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Tessa" wrote in message
...
Is it possible to create a macro that deletes the workbook
it's saved in ?





All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com