ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I get an excel macro to close without saving ! (https://www.excelbanter.com/excel-programming/340720-how-can-i-get-excel-macro-close-without-saving.html)

Roger O

How can I get an excel macro to close without saving !
 
I have worksheets email to me. I want to have a simple macro to close them
without saving them, to keep the integrity of what was emailed to me. Is
there a way of doing this ??

thanks ... Roger



Dr. Stephan Kassanke

How can I get an excel macro to close without saving !
 

"Roger O" schrieb im Newsbeitrag
...
I have worksheets email to me. I want to have a simple macro to close them
without saving them, to keep the integrity of what was emailed to me. Is
there a way of doing this ??

thanks ... Roger


Hi Roger,

try

application.DisplayAlerts= False
Workbooks("whatever").Close
application.DisplayAlerts= true

cheers,
Stephan



Nigel[_20_]

How can I get an excel macro to close without saving !
 
Try
Application.Quit

Regards
Nigel


Roger O

How can I get an excel macro to close without saving !
 
Great, many thanks guys

Roger

"Nigel" wrote in message
oups.com...
Try
Application.Quit

Regards
Nigel




Dr. Stephan Kassanke

How can I get an excel macro to close without saving !
 

"Dr. Stephan Kassanke" schrieb im Newsbeitrag
...

"Roger O" schrieb im Newsbeitrag
...
I have worksheets email to me. I want to have a simple macro to close them
without saving them, to keep the integrity of what was emailed to me. Is
there a way of doing this ??

thanks ... Roger


Hi Roger,

try

application.DisplayAlerts= False
Workbooks("whatever").Close
application.DisplayAlerts= true

cheers,
Stephan


or more elegant

Workbooks("whatever").Close SaveChanges:=False

cheers,
Stephan




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

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