Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Force Read-Only?
I share a workbook (Excel 2000) on a company-wide server. The users will
filter and hide columns and rows, and I'm afraid someone will save the changes so the next user opens up a file of garbage. I can right-click the file icon and set the properties to Read-Only, but someone can simply change it back, then do their damage. Is it possible to create a BeforeOpen event that will force this to Read-Only, regardless of what the user has done before opening the file? Ed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Force Read-Only?
Ed,
In the Workbook_Open Event...... Private Sub Workbook_Open() If ActiveWorkbook.ReadOnly = False Then ThisWorkbook.Saved = True ThisWorkbook.ChangeFileAccess xlReadOnly End If End Sub Note though that the user could still get to the VBA Editor and type the following into the Immediate window: ThisWorkbook.ChangeFileAccess xlReadWrite To change it back. John Ed wrote: I share a workbook (Excel 2000) on a company-wide server. The users will filter and hide columns and rows, and I'm afraid someone will save the changes so the next user opens up a file of garbage. I can right-click the file icon and set the properties to Read-Only, but someone can simply change it back, then do their damage. Is it possible to create a BeforeOpen event that will force this to Read-Only, regardless of what the user has done before opening the file? Ed |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Force Read-Only?
Thank you, John. This may have solved a big issue for me.
I'm not so worried about a our users going into the code. Most of them are "trained" well enough not to do that. But we do have ways of tracking down the others. Ed "John Wilson" wrote in message ... Ed, In the Workbook_Open Event...... Private Sub Workbook_Open() If ActiveWorkbook.ReadOnly = False Then ThisWorkbook.Saved = True ThisWorkbook.ChangeFileAccess xlReadOnly End If End Sub Note though that the user could still get to the VBA Editor and type the following into the Immediate window: ThisWorkbook.ChangeFileAccess xlReadWrite To change it back. John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Force excel to read dates as D/M/YYYY | Excel Worksheet Functions | |||
Force read-only in auto_open macro | Excel Discussion (Misc queries) | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
Force File Read-Only? | Excel Programming |