View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] hojikuru@yahoo.co.jp is offline
external usenet poster
 
Posts: 8
Default Protect sheet while enabling outlines and custom views

(I'm using XL 2002.)

Actually, Dave, this sounds somewhat promising. Would this work ...

1. Protect the workbook.
2. Share it. (assumption is that protection stays active from this
point.)
3. enableoutlining in the workbookopen module, so it sets the
parameter each time the workbook is opened.

Neither protection nor sharing would change, but the nonpersistent
..enableoutlining parameter could be reset upon each open.

If this would work, would you be so kind as to take a stab at the code
I would use (one-liner, I am guessing) and confirm that I put it in
the ThisWorkbook object (under Workbook / Open)? I'm very new to VBA
and could use all help avail.

Thanks.
ML


Dave Peterson wrote in message ...
The .enableoutlining has to be set each time the workbook opens. So you've
still got the problem.

Debra Dalgleish suggested a possible workaround for autofiltering.

She said something like create a new worksheet (unprotected).
fill it with formulas like:
=if(sheet1!a1="","",sheet1!a1)

And put your outlining there.


In xl2002, they have an option to allow autofiltering on protected worksheets.
Maybe outlining will see its day in the sun in a future version.

wrote:

Thanks for replying, Dave.

Can I enable outlining (and hide/unhide columns/rows), protect the
workbook, then share it? Will the outlining still work once the
workbook is closed and reopened?

I don't mind leaving the workbook protected once it's shared, but I
need to have both some way, while still being able to use outline and
custom views.

Thanks,
ML.

Dave Peterson wrote in message ...
If you protect the sheet in code, you can enableoutlining.

But the bad news is you can't change the protection of a worksheet in a shared
workbook.

I think you have to make a choice.


wrote:

I saw several posts outlining how to enable the outline function (Data
... Group and Outline ... Group). Very helpful. Thanks.

Is there some way also to enable custom views which hide certain
*sheets* and hide *rows/columns*?

I have the following code that runs when the workbook is opened:
--------------------------------
Private Sub Workbook_Open()
ActiveWorkbook.CustomViews("Navigation").Show
MsgBox "Please select the appropriate view on the Navigation tab:
summaries on left, working views on right.", vbOKOnly, "[snip name]"
End Sub
--------------------------------
So, the user interface depends on the use of radio buttons, which in
turn call out custom views as such (for example):
--------------------------------
Private Sub OptionButton7_Click()
ActiveWorkbook.CustomViews("2004 Q1 Full View").Show
End Sub
--------------------------------

So, if I want both the outline function to work and the custom views
to work in a *protected and shared* worksheet, is there any way to do
that?

Will the ranges I have defined for users to be able to edit still work
if protection is invoked from VBA upon workbook open, or will I have
to explicitly define editable ranges in the VBA code?

Thanks, ... and pardon the long list of questions.
Michael Lambert.