Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Write macro don't ask to save when exit excel

Hi all

I need to write a macro that when I exit Excel (or close document) by
clickin in the Red Cross of Excel Officce XP) domn't ask to save a document.
I've already tested some parts of code as show below:

strName = Activeworkbook.name
workbooks(strName).Close SaveChanges:=False

ThisWorkbook.Saved = True
Application.Quit

Application.DisplayAlerts=False

Application.EnableEvents = False

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Me.Saved = False Then Me.Saved = True
End Sub

but all of them don't worked like I want.
Anybody knows??

Thanks in advance

Rui Ávares


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
Why does Excel ask to Save on Exit? JRSNHECI Excel Discussion (Misc queries) 5 December 18th 08 04:10 AM
how do I write a request to 'Save As' Macro CRAIG K[_2_] Excel Discussion (Misc queries) 5 March 10th 08 01:31 PM
Excel 2003 Will Not Save On Exit tmyhlfgr Excel Discussion (Misc queries) 2 November 3rd 05 02:45 PM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM
How do I write a macro in XL that will delete 1st row and save th. Nitin Excel Programming 1 March 16th 05 04:04 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"