Force Read-Only?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

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
 
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
 
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
 
Back
Top