Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Macro Help

Gentlemen,


Is there any VBA command that avoid the Message " Do you want
save...... YES NO CANCEL" when I am using the command"
ActiveWindow.Close. This message make my macro be interrupted.


Similar is the message that appear when do a copy and I close the file,
" There is a large amount of information on Clipboard......".
I want to avoid this kind of message.

Thanks

Rubens



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Excel Macro Help

To avoid "Do you want to save"...

Application.DisplayAlerts = False
ActiveWindow.Close

To avoid the clipboard message...

Application.CutCopyMode = False

--
Dianne

In ,
raraujo typed:

Is there any VBA command that avoid the Message " Do you want
save...... YES NO CANCEL" when I am using the command"
ActiveWindow.Close. This message make my macro be interrupted.

Similar is the message that appear when do a copy and I close the
file, " There is a large amount of information on Clipboard......".
I want to avoid this kind of message.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Excel Macro Help

Avoid message.

Application.DisplayAlerts = False
'Your code here.
Application.DisplayAlerts = True

----------------------------------------------------------------
Clipboard warning.

After the paste,

Application.CutCopyMode - False

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Gentlemen,


Is there any VBA command that avoid the Message " Do you want
save...... YES NO CANCEL" when I am using the command"
ActiveWindow.Close. This message make my macro be interrupted.


Similar is the message that appear when do a copy and I close the file,
" There is a large amount of information on Clipboard......".
I want to avoid this kind of message.

Thanks

Rubens


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Excel Macro Help

Rubens,

If you want the workbook to be saved before closing, use

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub

If you don't want it saved, use

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub

Put this in the ThisWorkbook code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"raraujo" wrote in message
...
Gentlemen,


Is there any VBA command that avoid the Message " Do you want
save...... YES NO CANCEL" when I am using the command"
ActiveWindow.Close. This message make my macro be interrupted.


Similar is the message that appear when do a copy and I close the file,
" There is a large amount of information on Clipboard......".
I want to avoid this kind of message.

Thanks

Rubens



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Macro Help

Application.Cutcopymode = False
ActiveWindow.Close SaveChanges:=True

or make it false if you don't want to save changes).

--
Regards,
Tom Ogilvy


"raraujo" wrote in message
...
Gentlemen,


Is there any VBA command that avoid the Message " Do you want
save...... YES NO CANCEL" when I am using the command"
ActiveWindow.Close. This message make my macro be interrupted.


Similar is the message that appear when do a copy and I close the file,
" There is a large amount of information on Clipboard......".
I want to avoid this kind of message.

Thanks

Rubens



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


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

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"