ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protecting all sheets in a workbook (https://www.excelbanter.com/excel-programming/294774-protecting-all-sheets-workbook.html)

abxy[_48_]

Protecting all sheets in a workbook
 
Ok, here's my little problem: starting in a few days, i'll need to le
another department see the my workbook's data through the network
since the workbook is always being updated througout the day, it'd b
nice for them to be able to keep the workbook open and it refreshe
every so often to reflect the changes made, but at the same time als
It's *extremely* important that they can't alter any data in th
workbook whatsoever. So i'm asking for advice, what should and can
do?

thanks :

--
Message posted from http://www.ExcelForum.com


Bob Umlas

Protecting all sheets in a workbook
 
Right-click the Excel LOGO near the File menu, select View code, enter this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
End Sub

Woekbook is now unsavable.
If you want to allow YOU to save it, put some text in a cell which you can
test, like "OK" in cell F1, then alter the above to:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = (Sheets(1).Range("F1").Value<"OK")
End Sub

Bob Umlas
Excel MVP

"abxy " wrote in message
...
Ok, here's my little problem: starting in a few days, i'll need to let
another department see the my workbook's data through the network,
since the workbook is always being updated througout the day, it'd be
nice for them to be able to keep the workbook open and it refreshes
every so often to reflect the changes made, but at the same time also
It's *extremely* important that they can't alter any data in the
workbook whatsoever. So i'm asking for advice, what should and can I
do?

thanks :)


---
Message posted from http://www.ExcelForum.com/




abxy[_49_]

Protecting all sheets in a workbook
 
can i change that code around some how to say, if the workbook isn't i
"this" particular path, then this code for not letting you save i
applied

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:26 AM.

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