Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Disable option save when close excel

Hi,

I'm making a macro that open an excel document only for consulting.
So, if anybody makes changes in it, the changes can not be saved.
For that, when the document is closed, I need inhibit the window asking if
we want save it.
If anybody knows how make it, I'm very pleasure.

Thamks in advance.

Rui Álvares


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Disable option save when close excel


Exit without saving
Posted by Mark O'Brien on September 27, 2001 11:53 AM

Insert this code onto the workbook object
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Me.Saved = False Then Me.Saved = True
End Sub

that should work.


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=522415

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Disable option save when close excel

Just a thought for the OP if looking for a reliable method, if Macros are
disabled, then this will not work.

You might make the workbook ReadOnly (although this can be defeated as
well).

--
Regards,
Tom Ogilvy


"davesexcel" wrote
in message ...

Exit without saving
Posted by Mark O'Brien on September 27, 2001 11:53 AM

Insert this code onto the workbook object
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Me.Saved = False Then Me.Saved = True
End Sub

that should work.


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile:

http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=522415



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
Excel 2007: How do I disable the 'Do you wish to save changes to...' when I close an un changed file? anctech Excel Discussion (Misc queries) 4 June 15th 07 10:42 AM
Save-As Option Disable Salman Excel Worksheet Functions 0 January 9th 07 12:09 PM
Disable "save" option on close. PG Excel Discussion (Misc queries) 2 September 6th 06 12:15 AM
Option in Excel to save a close a workbook inactive for 5 minutes Patricia Peterson Excel Discussion (Misc queries) 4 January 5th 06 05:00 PM
Disable "Save As" Option Andy T Excel Discussion (Misc queries) 1 December 10th 04 10:23 AM


All times are GMT +1. The time now is 04:57 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"