Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Read Only Prompt | Excel Discussion (Misc queries) | |||
Password Prompt With Read Only Option | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
Remove read only prompt | Excel Discussion (Misc queries) | |||
shared and read-only | Excel Discussion (Misc queries) |