Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Force File Read-Only?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force excel to read dates as D/M/YYYY S Davis Excel Worksheet Functions 6 May 12th 08 07:00 PM
Force read-only in auto_open macro hhalle Excel Discussion (Misc queries) 0 August 20th 06 10:44 AM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM
How do I force an Excel macro to ask me which file and directory? Ramius Excel Discussion (Misc queries) 4 January 14th 05 03:26 PM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"