ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Disable save on read only?? (https://www.excelbanter.com/excel-discussion-misc-queries/236050-disable-save-read-only.html)

Gazz_85[_2_]

Disable save on read only??
 
is it possible for me to disable the save option on a read only file. I have
a file on the network which is shared. however when people open a read only
version and save it as a copy, then peopple are opening the copy version and
updating date, resulting in lost data and a lot of double handeling!!

any help??

Eduardo

Disable save on read only??
 
Hi,
unfortunately if the user open as read only the file they still can save it
just changing the name. The users have to realize that doing that result in
lost data

"Gazz_85" wrote:

is it possible for me to disable the save option on a read only file. I have
a file on the network which is shared. however when people open a read only
version and save it as a copy, then peopple are opening the copy version and
updating date, resulting in lost data and a lot of double handeling!!

any help??


Luke M

Disable save on read only??
 
What Eduardo said is correct. However, if macros are enables, you can provide
reminders/hindrances. For example, if you open the VBA editor (Alt+F11) and
paste this into the ThisWorkbook module, it will cause a warning message to
appear reminding people that they can't save, and then close the workbook
without actually saving.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
MsgBox "You are not allowed to save this workbook", vbOKOnly, "No Saving"
ThisWorkbook.Close SaveChanges:=False
End Sub


Note that, to set this up, you need to disable macros, write this in, and
then save. Then, re-enable macros. Otherwise, your own macro will prevent you
from saving!
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Gazz_85" wrote:

is it possible for me to disable the save option on a read only file. I have
a file on the network which is shared. however when people open a read only
version and save it as a copy, then peopple are opening the copy version and
updating date, resulting in lost data and a lot of double handeling!!

any help??


Mike H

Disable save on read only??
 
Hi,

You can test for read only and prevent save if it is or allow save if it
isn't. The wheels come off though if macros aren't enabled

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If ActiveWorkbook.ReadOnly Then
MsgBox "File was opened as read-only and cannot be saved"
Cancel = True
ActiveWorkbook.Close savechanges:=False
Else
MsgBox "File was not opened as read-only and can be saved"
End If
End Sub

Mike

"Gazz_85" wrote:

is it possible for me to disable the save option on a read only file. I have
a file on the network which is shared. however when people open a read only
version and save it as a copy, then peopple are opening the copy version and
updating date, resulting in lost data and a lot of double handeling!!

any help??



All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com