LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Strange problems with setting hidden property of a range when sheet protected with UserInterfaceOnly

Hi,

I have run into a problem that makes no sense. I have protected my
sheets using the UserInterfaceOnly=True parameter for some time, and it
has worked fine until now. I'll illustrate the problem with a few
examples.

When the document is opened, in the workbook_open() function, I can do
the following without problem:

Sheet1.Unprotect
Sheet1.Protect UserInterfaceOnly:=True
Sheet1.Range("A1").EntireRow.Hidden = True

So here the UserInterfaceOnly protection seems to work OK. However,
when I later execute the following code in Sheet1:

Sheet1.Range("A1").Value = 123
Sheet1.Range("A1").EntireRow.Hidden = True

.... Setting the value of the locked cell A1 works fine, but trying to
hide the row, I get the "Cannot set hidden property of range object"
error.

I also tested doing a unprotect+protect right before the calls, but it
didn't change anything. Unprotecting the sheet without reprotecting it,
did however make the problem disappear, so it is somehow related to the
protection.

Another odd thing is that the VB Editor does not automatically fix the
case of the userinterfaceonly-parameter. Case is corrected for other
parameter names. It does show it in the parameter list popup, though.
I'm using Excel 2002.

Anyone encountered anything like this? Ideas for debugging? Is there a
way to query the status of the userinterfaceonly-bit for a worksheet?

 
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
showing hidden rows on a protected sheet cathy Excel Discussion (Misc queries) 10 June 6th 08 10:13 PM
A QueryTable refresh, a named range, the 'Hidden' property Gregory Kip Excel Programming 0 February 23rd 06 08:35 PM
1004 - Unable to set the hidden property of the range class Tim Whitley Excel Programming 3 February 20th 06 09:50 PM
setting range().hidden=True causes range error 1004 STEVE BELL Excel Programming 6 September 2nd 05 02:16 AM
Protection UserInterfaceOnly reading Hidden Formulas Rik Ditter Excel Programming 1 July 12th 03 12:50 PM


All times are GMT +1. The time now is 02:52 AM.

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

About Us

"It's about Microsoft Excel"