Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Shared/Read Only WITHOUT Save prompt

Excel 2002 spreadsheet used as a reference guide. I wish to keep readonly
attribute and allow temporary calcs upon open; however, I do not want them to
receive the "Do you want to save changes prompt" when the file is closed
since I don't want their changes saved anyway. Can I suppress the prompt
without saving? Thank you!
--
tmb
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default Shared/Read Only WITHOUT Save prompt

Right-click the Excel LOGO (near the file menu), select View Code, put this in:

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


"tbatftc" wrote:

Excel 2002 spreadsheet used as a reference guide. I wish to keep readonly
attribute and allow temporary calcs upon open; however, I do not want them to
receive the "Do you want to save changes prompt" when the file is closed
since I don't want their changes saved anyway. Can I suppress the prompt
without saving? Thank you!
--
tmb

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Shared/Read Only WITHOUT Save prompt

Thank you Bob. Since I am the only one who will make updates on very rare
occasions, I will just remember to remove the code during those times, after
I take off the readonly property.
--
tmb


"Bob Umlas, Excel MVP" wrote:

Right-click the Excel LOGO (near the file menu), select View Code, put this in:

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


"tbatftc" wrote:

Excel 2002 spreadsheet used as a reference guide. I wish to keep readonly
attribute and allow temporary calcs upon open; however, I do not want them to
receive the "Do you want to save changes prompt" when the file is closed
since I don't want their changes saved anyway. Can I suppress the prompt
without saving? Thank you!
--
tmb

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Shared/Read Only WITHOUT Save prompt

Unshare the workbook to access the VB Editor.

Place this in Thisworkbook module.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
ThisWorkbook.Saved = True 'Excel thinks it is saved but is not
Application.DisplayAlerts = True
End Sub

Re-share which will save the workbook with the code.

Close, re-open, make some some changes then close.

The workbook will close with no save changes and no message.

You may want this also to prevent the workbook from being saved by users
before closing.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Cancel = True
MsgBox "You are not authorized to save this workbook"
End Sub

You will have to disable events in order to save the workbook once with the
second event code then re-enable events after saving.


Gord Dibben MS Excel MVP


On Mon, 22 Dec 2008 08:44:00 -0800, tbatftc
wrote:

Excel 2002 spreadsheet used as a reference guide. I wish to keep readonly
attribute and allow temporary calcs upon open; however, I do not want them to
receive the "Do you want to save changes prompt" when the file is closed
since I don't want their changes saved anyway. Can I suppress the prompt
without saving? Thank you!


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
Read Only Prompt Scott Excel Discussion (Misc queries) 2 September 26th 07 04:04 PM
Password Prompt With Read Only Option Paperback Writer Excel Discussion (Misc queries) 2 August 14th 06 10:39 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Remove read only prompt macsaintly Excel Discussion (Misc queries) 3 September 2nd 05 05:49 AM
shared and read-only Susan Excel Discussion (Misc queries) 1 May 10th 05 11:44 PM


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