View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed[_9_] Ed[_9_] is offline
external usenet poster
 
Posts: 194
Default 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