View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bill Lunney Bill Lunney is offline
external usenet poster
 
Posts: 68
Default Force File Read-Only?

Sounds like you're better just blocking the Save event altogether.
Something like this added to the workbook code module will do the job.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Cancel = True
End Sub

This has the advantage that you can specifiy the criteria used to decide if
a file can be saved.


http://www.billlunney.com/Excel/FAQ/...ExcelFAQID=211


--

Regards,


Bill Lunney
www.billlunney.com

"Ed" wrote in message
...
I am using Win2000 and Excel 2000. I put a workbook onto a company-wide
server, and I'm afraid users are going to screw it up so another user

opens
a file of garbage. The users are going to have to be able to filter and
hide columns and rows.

I can right-click on the file and set its property to Read-Only, so no
changes get saved when the file closes. But I'm concerned that someone

will
simply turn it off. Is there any way to code a BeforeOpen action that

will
set this property to Read-Only, regardless of how it was checked/unchecked
when the user opened it?

Ed