PC Review


Reply
Thread Tools Rate Thread

Custom View: hide/unhide does not work when worksheet is protected

 
 
pwrichcreek
Guest
Posts: n/a
 
      5th Jan 2008
In a protected worksheet I want to hide/unhide certain columns using Custom
Views. The column hiding/unhiding works fine as long as the worksheet is not
protected, but I get the following message and the columns are not properly
hidden/unhidden, when the worksheet is protected:

"Some view settings could not be applied".

I hoped that checking the checkbox "Format Columns" in the Protect dialog --
that is, allowing users to "format columns" when the sheet is protected --
would do the trick, but that does not seem to be the case. In fact, I tried
checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
says:

"Format columns When cleared, prevents users from using any of the
commands on the Column submenu of the Format menu, including changing column
width or hiding columns."

The "Format Columns" DOES allow me to manually hide and unhide columns, even
when the sheet is protected, but it just doesn't happen automatically as part
of the Custom View.

Is there some other way to accomplish what I want?

I don't mind writing some code, but I'm unclear on where to put it. What
event or action would trigger just before a Custom View is carried out? Seems
I could turn off protection to let the Custom View hide/unhide the desired
columns. But then I would need to turn protection back on and I'm not sure
where/how that piece of code would get executed.

Any thoughts or suggestions will be appreciated.

TIA,

Phil

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      5th Jan 2008
Other than the limited facilities provided for when setting the protection
parameters, you cannot make changes without unprotecting the sheet. That is
the purpose of the protection.

"pwrichcreek" wrote:

> In a protected worksheet I want to hide/unhide certain columns using Custom
> Views. The column hiding/unhiding works fine as long as the worksheet is not
> protected, but I get the following message and the columns are not properly
> hidden/unhidden, when the worksheet is protected:
>
> "Some view settings could not be applied".
>
> I hoped that checking the checkbox "Format Columns" in the Protect dialog --
> that is, allowing users to "format columns" when the sheet is protected --
> would do the trick, but that does not seem to be the case. In fact, I tried
> checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
> says:
>
> "Format columns When cleared, prevents users from using any of the
> commands on the Column submenu of the Format menu, including changing column
> width or hiding columns."
>
> The "Format Columns" DOES allow me to manually hide and unhide columns, even
> when the sheet is protected, but it just doesn't happen automatically as part
> of the Custom View.
>
> Is there some other way to accomplish what I want?
>
> I don't mind writing some code, but I'm unclear on where to put it. What
> event or action would trigger just before a Custom View is carried out? Seems
> I could turn off protection to let the Custom View hide/unhide the desired
> columns. But then I would need to turn protection back on and I'm not sure
> where/how that piece of code would get executed.
>
> Any thoughts or suggestions will be appreciated.
>
> TIA,
>
> Phil
>

 
Reply With Quote
 
pwrichcreek
Guest
Posts: n/a
 
      6th Jan 2008
Thanks for your reply.

> ... you cannot make changes without unprotecting the sheet. That is
> the purpose of the protection.


I know the purpose of protection. As I stated in my message, I set the
protection parameters to allow "Format Columns", meaning hide/unhide should
be allowed even when the sheet is protected.

>The "Format Columns" DOES allow me to manually hide and unhide columns, >even when the sheet is protected, but it just doesn't happen automatically as part
>of the Custom View


It seems logical that, if "Format Columns" allows me to hide and unhide
manually when the sheet is protected, then hide and unhide should also be
allowed when implied by the View -- hidden columns are a part of the view.
That logic would seem to be supported by the HELP information. But apparently
it just ain't so.

So I am resigned to the fact that, despite logic and despite what the HELP
says, I will probably need to write some code. The questions is where to put
such code.

Phil


"JLGWhiz" wrote:

> Other than the limited facilities provided for when setting the protection
> parameters, you cannot make changes without unprotecting the sheet. That is
> the purpose of the protection.
>
> "pwrichcreek" wrote:
>
> > In a protected worksheet I want to hide/unhide certain columns using Custom
> > Views. The column hiding/unhiding works fine as long as the worksheet is not
> > protected, but I get the following message and the columns are not properly
> > hidden/unhidden, when the worksheet is protected:
> >
> > "Some view settings could not be applied".
> >
> > I hoped that checking the checkbox "Format Columns" in the Protect dialog --
> > that is, allowing users to "format columns" when the sheet is protected --
> > would do the trick, but that does not seem to be the case. In fact, I tried
> > checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
> > says:
> >
> > "Format columns When cleared, prevents users from using any of the
> > commands on the Column submenu of the Format menu, including changing column
> > width or hiding columns."
> >
> > The "Format Columns" DOES allow me to manually hide and unhide columns, even
> > when the sheet is protected, but it just doesn't happen automatically as part
> > of the Custom View.
> >
> > Is there some other way to accomplish what I want?
> >
> > I don't mind writing some code, but I'm unclear on where to put it. What
> > event or action would trigger just before a Custom View is carried out? Seems
> > I could turn off protection to let the Custom View hide/unhide the desired
> > columns. But then I would need to turn protection back on and I'm not sure
> > where/how that piece of code would get executed.
> >
> > Any thoughts or suggestions will be appreciated.
> >
> > TIA,
> >
> > Phil
> >

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      6th Jan 2008
Yes, I misread your original posting. The only two things I could see were
that if your sheet contains a List, then the custom view won't work. The
second was in the dialog box to add the view that the Hidden Columns, Rows
and Filter settings checkbox needs to be either checked or unchecked. If you
don't have a List and the checkbox is set right, then you should get your
view.

"pwrichcreek" wrote:

> Thanks for your reply.
>
> > ... you cannot make changes without unprotecting the sheet. That is
> > the purpose of the protection.

>
> I know the purpose of protection. As I stated in my message, I set the
> protection parameters to allow "Format Columns", meaning hide/unhide should
> be allowed even when the sheet is protected.
>
> >The "Format Columns" DOES allow me to manually hide and unhide columns, >even when the sheet is protected, but it just doesn't happen automatically as part
> >of the Custom View

>
> It seems logical that, if "Format Columns" allows me to hide and unhide
> manually when the sheet is protected, then hide and unhide should also be
> allowed when implied by the View -- hidden columns are a part of the view.
> That logic would seem to be supported by the HELP information. But apparently
> it just ain't so.
>
> So I am resigned to the fact that, despite logic and despite what the HELP
> says, I will probably need to write some code. The questions is where to put
> such code.
>
> Phil
>
>
> "JLGWhiz" wrote:
>
> > Other than the limited facilities provided for when setting the protection
> > parameters, you cannot make changes without unprotecting the sheet. That is
> > the purpose of the protection.
> >
> > "pwrichcreek" wrote:
> >
> > > In a protected worksheet I want to hide/unhide certain columns using Custom
> > > Views. The column hiding/unhiding works fine as long as the worksheet is not
> > > protected, but I get the following message and the columns are not properly
> > > hidden/unhidden, when the worksheet is protected:
> > >
> > > "Some view settings could not be applied".
> > >
> > > I hoped that checking the checkbox "Format Columns" in the Protect dialog --
> > > that is, allowing users to "format columns" when the sheet is protected --
> > > would do the trick, but that does not seem to be the case. In fact, I tried
> > > checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
> > > says:
> > >
> > > "Format columns When cleared, prevents users from using any of the
> > > commands on the Column submenu of the Format menu, including changing column
> > > width or hiding columns."
> > >
> > > The "Format Columns" DOES allow me to manually hide and unhide columns, even
> > > when the sheet is protected, but it just doesn't happen automatically as part
> > > of the Custom View.
> > >
> > > Is there some other way to accomplish what I want?
> > >
> > > I don't mind writing some code, but I'm unclear on where to put it. What
> > > event or action would trigger just before a Custom View is carried out? Seems
> > > I could turn off protection to let the Custom View hide/unhide the desired
> > > columns. But then I would need to turn protection back on and I'm not sure
> > > where/how that piece of code would get executed.
> > >
> > > Any thoughts or suggestions will be appreciated.
> > >
> > > TIA,
> > >
> > > Phil
> > >

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      6th Jan 2008
Sub changeviews()

ActiveSheet.Unprotect Password:="justme"
Application.Dialogs(xlDialogCustomViews).Show
ActiveSheet.Protect Password:="justme"

End Sub

Run the macro and select a view from the dialog box when it pops up.

Note: if the chosen custom view leaves you on another worksheet, that sheet
becomes the activesheet so you must trap for that or hard-code the sheetname.

Sheets("Sheet1").Unprotect Password:="justme"
Application.Dialogs(xlDialogCustomViews).Show
Sheets("Sheet1").Protect Password:="justme"


Gord Dibben MS Excel MVP

On Sat, 5 Jan 2008 13:14:01 -0800, pwrichcreek
<(E-Mail Removed)> wrote:

>In a protected worksheet I want to hide/unhide certain columns using Custom
>Views. The column hiding/unhiding works fine as long as the worksheet is not
>protected, but I get the following message and the columns are not properly
>hidden/unhidden, when the worksheet is protected:
>
>"Some view settings could not be applied".
>
>I hoped that checking the checkbox "Format Columns" in the Protect dialog --
>that is, allowing users to "format columns" when the sheet is protected --
>would do the trick, but that does not seem to be the case. In fact, I tried
>checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
>says:
>
>"Format columns When cleared, prevents users from using any of the
>commands on the Column submenu of the Format menu, including changing column
>width or hiding columns."
>
>The "Format Columns" DOES allow me to manually hide and unhide columns, even
>when the sheet is protected, but it just doesn't happen automatically as part
>of the Custom View.
>
>Is there some other way to accomplish what I want?
>
>I don't mind writing some code, but I'm unclear on where to put it. What
>event or action would trigger just before a Custom View is carried out? Seems
>I could turn off protection to let the Custom View hide/unhide the desired
>columns. But then I would need to turn protection back on and I'm not sure
>where/how that piece of code would get executed.
>
>Any thoughts or suggestions will be appreciated.
>
>TIA,
>
>Phil


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      6th Jan 2008
Check for my other post coming through.

I forgot to tell you to place the code in a general module and assign the macro
to a button or shortcut key combo.


Gord Dibben MS Excel MVP

On Sat, 5 Jan 2008 16:54:00 -0800, pwrichcreek
<(E-Mail Removed)> wrote:

>Thanks for your reply.
>
>> ... you cannot make changes without unprotecting the sheet. That is
>> the purpose of the protection.

>
>I know the purpose of protection. As I stated in my message, I set the
>protection parameters to allow "Format Columns", meaning hide/unhide should
>be allowed even when the sheet is protected.
>
>>The "Format Columns" DOES allow me to manually hide and unhide columns, >even when the sheet is protected, but it just doesn't happen automatically as part
>>of the Custom View

>
>It seems logical that, if "Format Columns" allows me to hide and unhide
>manually when the sheet is protected, then hide and unhide should also be
>allowed when implied by the View -- hidden columns are a part of the view.
>That logic would seem to be supported by the HELP information. But apparently
>it just ain't so.
>
>So I am resigned to the fact that, despite logic and despite what the HELP
>says, I will probably need to write some code. The questions is where to put
>such code.
>
>Phil
>
>
>"JLGWhiz" wrote:
>
>> Other than the limited facilities provided for when setting the protection
>> parameters, you cannot make changes without unprotecting the sheet. That is
>> the purpose of the protection.
>>
>> "pwrichcreek" wrote:
>>
>> > In a protected worksheet I want to hide/unhide certain columns using Custom
>> > Views. The column hiding/unhiding works fine as long as the worksheet is not
>> > protected, but I get the following message and the columns are not properly
>> > hidden/unhidden, when the worksheet is protected:
>> >
>> > "Some view settings could not be applied".
>> >
>> > I hoped that checking the checkbox "Format Columns" in the Protect dialog --
>> > that is, allowing users to "format columns" when the sheet is protected --
>> > would do the trick, but that does not seem to be the case. In fact, I tried
>> > checking ALL THE CHECKBOXES and that did not allow hide/unhide columns. HELP
>> > says:
>> >
>> > "Format columns When cleared, prevents users from using any of the
>> > commands on the Column submenu of the Format menu, including changing column
>> > width or hiding columns."
>> >
>> > The "Format Columns" DOES allow me to manually hide and unhide columns, even
>> > when the sheet is protected, but it just doesn't happen automatically as part
>> > of the Custom View.
>> >
>> > Is there some other way to accomplish what I want?
>> >
>> > I don't mind writing some code, but I'm unclear on where to put it. What
>> > event or action would trigger just before a Custom View is carried out? Seems
>> > I could turn off protection to let the Custom View hide/unhide the desired
>> > columns. But then I would need to turn protection back on and I'm not sure
>> > where/how that piece of code would get executed.
>> >
>> > Any thoughts or suggestions will be appreciated.
>> >
>> > TIA,
>> >
>> > Phil
>> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide unhide rows -Protected sheet Wanna Learn Microsoft Excel Misc 3 5th Aug 2009 05:43 PM
Hide / Unhide Columns in Password Protected w/s monir Microsoft Excel Programming 2 12th Jan 2008 12:44 AM
hide ,unhide columns on protected worksheet =?Utf-8?B?a2FtbGVzaA==?= Microsoft Excel Programming 1 11th Jan 2007 04:17 PM
How to view a custom view when the worksheet is protected? =?Utf-8?B?SnVsZXNKYW0=?= Microsoft Excel Worksheet Functions 0 6th Mar 2006 02:15 PM
how do i unhide a worksheet in excel 2003? unhide tab don't work =?Utf-8?B?bWlrZWtlYXQ=?= Microsoft Excel Misc 2 6th Mar 2006 03:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:04 AM.