Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Setup / October 2003

Tip: Looking for answers? Try searching our database.

protecting worksheet with outlines

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
smiller - 08 Oct 2003 16:47 GMT
I would like to protect  the content of a worksheet with
three outline views. If I uncheck protect contents it
allows others to change data. If checked, I can't change
the views.
Dave Peterson - 09 Oct 2003 01:31 GMT
If you protect the sheet in code (auto_open/workbook_open??), you can allow
this:

Option Explicit
Sub auto_open()
   With Worksheets("sheet1")
       .Protect Password:="hi", userinterfaceonly:=True
       .EnableOutlining = True
   End With
End Sub

It needs to be reset each time you open the workbook.  (excel doesn't remember
it after closing the workbook.)

(you could use the workbook_open even under ThisWorkbook, too.)

Don't forget to lock the VBA Project, too.  Else you'll have inquisitive types
looking at your code and seeing the password.

Inside the VBE, you can lock the project.  
Tools|VBAProject Properties|Protection tab.
Give it a memorable password and lock the project for viewing.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

> I would like to protect  the content of a worksheet with
> three outline views. If I uncheck protect contents it
> allows others to change data. If checked, I can't change
> the views.

Signature

Dave Peterson
ec35720@msn.com

smiller - 09 Oct 2003 14:46 GMT
Thanks for your help!!!

>-----Original Message-----
>If you protect the sheet in code (auto_open/workbook_open??), you can allow
[quoted text clipped - 27 lines]
>> allows others to change data. If checked, I can't change
>> the views.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.