View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Open in Read Only

You can change the file access with code that will execute
automatically when the workbook is opened (assume that the user allows
code to run). In the ThisWorkbook code module, use

Private Sub Workbook_Open()
ThisWorkbook.ChangeFileAccess xlReadOnly
End Sub

To change back to read/write access, run the code

Sub MakeReadWrite()
On Error Resume Next
ThisWorkbook.ChangeFileAccess xlReadWrite
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Tue, 21 Oct 2008 09:32:08 -0700, Barb W
wrote:

Is there a way to open a file in read-only mode even if the file is not open
by another user? I sometimes want a file open for reference, but don't want
to prevent other people from opening and editing.