ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   closing without saving within a macro (https://www.excelbanter.com/excel-programming/317693-closing-without-saving-within-macro.html)

okanem[_2_]

closing without saving within a macro
 

I am trying to close a spreadsheet without saving any changes to it from
within a macro, but at the moment it keeps asking me do I want to save
changes.

The code so far is

Windows("control of contract - item 1.xls").Activate
ActiveWorkbook.Close

Can someone help.

I don't want to save before closing which would get rid of the message
because it takes about 10 seconds to close.

Thanks for any replies
Okanem


--
okanem
------------------------------------------------------------------------
okanem's Profile: http://www.excelforum.com/member.php...fo&userid=9301
View this thread: http://www.excelforum.com/showthread...hreadid=320054


Frank Kabel

closing without saving within a macro
 
Hi
use
application.displayalerts=false
ActiveWorkbook.Close


--
Regards
Frank Kabel
Frankfurt, Germany

"okanem" schrieb im Newsbeitrag
...

I am trying to close a spreadsheet without saving any changes to it

from
within a macro, but at the moment it keeps asking me do I want to

save
changes.

The code so far is

Windows("control of contract - item 1.xls").Activate
ActiveWorkbook.Close

Can someone help.

I don't want to save before closing which would get rid of the

message
because it takes about 10 seconds to close.

Thanks for any replies
Okanem


--
okanem
---------------------------------------------------------------------

---
okanem's Profile:

http://www.excelforum.com/member.php...fo&userid=9301
View this thread:

http://www.excelforum.com/showthread...hreadid=320054



Ron de Bruin

closing without saving within a macro
 
Or

ActiveWorkbook.Close False

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Frank Kabel" wrote in message ...
Hi
use
application.displayalerts=false
ActiveWorkbook.Close


--
Regards
Frank Kabel
Frankfurt, Germany

"okanem" schrieb im Newsbeitrag
...

I am trying to close a spreadsheet without saving any changes to it

from
within a macro, but at the moment it keeps asking me do I want to

save
changes.

The code so far is

Windows("control of contract - item 1.xls").Activate
ActiveWorkbook.Close

Can someone help.

I don't want to save before closing which would get rid of the

message
because it takes about 10 seconds to close.

Thanks for any replies
Okanem


--
okanem
---------------------------------------------------------------------

---
okanem's Profile:

http://www.excelforum.com/member.php...fo&userid=9301
View this thread:

http://www.excelforum.com/showthread...hreadid=320054






All times are GMT +1. The time now is 10:58 PM.

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