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

When i exit excel using the close 'X' top right of my page - it keeps
prompting me to save changes.I dont want it to save changes and just close.I
either want to get rid of the 'X' or use some code so it doesnt prompt me to
save.I am currently using this code but its not working for some reason.Any
help out there please...

Private Sub Workbook_Close()
Application.DisplayAlerts = False
Workbook.Close savechanges:=False
End Sub

Thks in adavnce
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Exit Workbook

Hi,
Try:

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

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Mark" wrote:

When i exit excel using the close 'X' top right of my page - it keeps
prompting me to save changes.I dont want it to save changes and just close.I
either want to get rid of the 'X' or use some code so it doesnt prompt me to
save.I am currently using this code but its not working for some reason.Any
help out there please...

Private Sub Workbook_Close()
Application.DisplayAlerts = False
Workbook.Close savechanges:=False
End Sub

Thks in adavnce
Mark

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Exit Workbook

Hi Mark,

Private Sub Workbook_Close()
Application.DisplayAlerts = False
Workbook.Close savechanges:=False
End Sub


Try, instead:

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


BTW, there is no Workbook_Close event.



---
Regards,
Norman



"Mark" wrote in message
...
When i exit excel using the close 'X' top right of my page - it keeps
prompting me to save changes.I dont want it to save changes and just
close.I
either want to get rid of the 'X' or use some code so it doesnt prompt me
to
save.I am currently using this code but its not working for some
reason.Any
help out there please...

Private Sub Workbook_Close()
Application.DisplayAlerts = False
Workbook.Close savechanges:=False
End Sub

Thks in adavnce
Mark



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
how to set auto protect workbook on exit? West Excel Worksheet Functions 4 October 2nd 06 03:19 AM
How can I exit a workbook in Excel without closing the program? cosborn Excel Discussion (Misc queries) 1 September 21st 06 09:19 PM
[Fwd: Run macro on exit worksheet/workbook] toontje Excel Discussion (Misc queries) 1 August 5th 05 03:49 AM
Run macro on exit worksheet/workbook toontje Excel Worksheet Functions 3 August 2nd 05 10:15 PM
Force no save on workbook exit R A Excel Programming 2 December 16th 04 05:07 PM


All times are GMT +1. The time now is 01:22 PM.

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"