Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for "close w/no save"?

In Word, I have created a couple helpful macros and placed
them on the toolbar with an icon. The piggybank will
close the open document and save all changes. The garbage
can will close the document and NOT save any changes.
This precludes me having to respond to the "do you want to
save changes?" prompt each time (annoying!).

They work slick in Word.

Now, I'd like to have the same feature in Excel, but the
macro design or language is different and I can't figure
it out.

Here's the simple one-line of code for the "close no save"
macro (in Word):
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

What would be the equivilent in Excel?

Thanks in advance.

Jerry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for "close w/no save"?

You can turn the alerts off...

Application.DisplayAlerts = False


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro for "close w/no save"?


-----Original Message-----
You can turn the alerts off...

Application.DisplayAlerts = False


---
Message posted from http://www.ExcelForum.com/

.


I'm not sure that will solve it. With the alerts turned
off, what happens if I have a file I've made changes to,
and want to save the changes, and I click the "X" to close
it (without having saved it first)?

What I want to be able to do is to "close and save"
or "close and not save" with one click of the mouse.

Will turning off the alerts do that?

Jerry
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro for "close w/no save"?

I've been working with it and I think I have it figured
out now.

Jerry
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for "close w/no save"?

You only put that code in the Garbage Can functio

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro for "close w/no save"?

It is the same as word
Activeworkbook.Close SaveChanges:=False

ActiveWorkbook.Close SaveChanges:=True

--
Regards,
Tom Ogilvy


wrote in message
...

-----Original Message-----
You can turn the alerts off...

Application.DisplayAlerts = False


---
Message posted from http://www.ExcelForum.com/

.


I'm not sure that will solve it. With the alerts turned
off, what happens if I have a file I've made changes to,
and want to save the changes, and I click the "X" to close
it (without having saved it first)?

What I want to be able to do is to "close and save"
or "close and not save" with one click of the mouse.

Will turning off the alerts do that?

Jerry



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Macro for "close w/no save"?

Hi Jerry,

Try:
ActiveWorkbook.Close SaveChanges:=False

---
Regards,
Norman



"Jerry C" wrote in message
...
In Word, I have created a couple helpful macros and placed
them on the toolbar with an icon. The piggybank will
close the open document and save all changes. The garbage
can will close the document and NOT save any changes.
This precludes me having to respond to the "do you want to
save changes?" prompt each time (annoying!).

They work slick in Word.

Now, I'd like to have the same feature in Excel, but the
macro design or language is different and I can't figure
it out.

Here's the simple one-line of code for the "close no save"
macro (in Word):
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

What would be the equivilent in Excel?

Thanks in advance.

Jerry



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
Suppress popup "Do you really want to save..." after open and immediate close of excel sheets ? Markus Obermayer Excel Discussion (Misc queries) 2 January 2nd 07 02:12 PM
Suppress popup "Do you really want to save..." after open and immediate close of excel sheets ? Markus Obermayer Excel Worksheet Functions 2 January 2nd 07 02:12 PM
Need a "save & close" button directly on spreadsheet Ron M. Excel Discussion (Misc queries) 1 October 27th 05 03:55 PM
Disable "Save" &/or "Close" universal[_4_] Excel Programming 3 October 25th 03 12:38 PM
How can I get "File Close" to prompt me to "Save Changes" ?? Charles Jordan Excel Programming 4 July 31st 03 04:01 PM


All times are GMT +1. The time now is 04:18 PM.

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"