Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Sheet protection

I want to protect sheet because I have some formulas that I don't want people
hace access to it to modify. But I have some cells that people will enter
some values and they give a message and change the cell color depends of the
value that they enter. My problem is when I protect the sheet using Tools
Protection Protect Sheet... and when I write the value that I want in the
cell when sheet is protected I have an error. I obtain the message that I
want but when the cell will change the color I received and error message
like: "Run-time eoor '1004': Unable to set the ColorIndex property of the
Interior class". How can I resolve that problem. When the sheet is
unprotected my code working great but when it protected I recived this
message.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Sheet protection

|I want to protect sheet because I have some formulas that I don't want
people
| hace access to it to modify. But I have some cells that people will enter
| some values and they give a message and change the cell color depends of
the
| value that they enter. My problem is when I protect the sheet using Tools

| Protection Protect Sheet... and when I write the value that I want in
the
| cell when sheet is protected I have an error. I obtain the message that I
| want but when the cell will change the color I received and error message
| like: "Run-time eoor '1004': Unable to set the ColorIndex property of the
| Interior class". How can I resolve that problem. When the sheet is
| unprotected my code working great but when it protected I recived this
| message.

What about to add a section to your macro to unprotect your sheet, then run
normally your code and then protect it again?

have a good day

Tomasz


  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Sheet protection

Hi anamarie30 -

From your description, you are likely using a Worksheet_Change event
procedure to change the interior color of the cell. I agree with Tomasz that
a good solution would be to unprotect the worksheet in your code.

Insert the statements 'ActiveSheet.Unprotect' and 'ActiveSheet.Protect'
before and after the statement(s) that cause the run-time error.

If the worksheet is password protected the statements must include the
password, for example, ActiveSheet.Unprotect "anamariespassword" and
ActiveSheet.Protect "anamariespassword".

----
Jay


"anamarie30" wrote:

I want to protect sheet because I have some formulas that I don't want people
hace access to it to modify. But I have some cells that people will enter
some values and they give a message and change the cell color depends of the
value that they enter. My problem is when I protect the sheet using Tools
Protection Protect Sheet... and when I write the value that I want in the
cell when sheet is protected I have an error. I obtain the message that I
want but when the cell will change the color I received and error message
like: "Run-time eoor '1004': Unable to set the ColorIndex property of the
Interior class". How can I resolve that problem. When the sheet is
unprotected my code working great but when it protected I recived this
message.

Thanks in advance.

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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Sheet Protection Maistrye[_6_] Excel Programming 3 July 29th 06 09:48 AM
Sheet protection Rev. Excel Programming 1 October 11th 04 03:56 PM
Sheet protection error msg - Unrequested sheet activation deltree[_3_] Excel Programming 0 January 28th 04 06:20 PM


All times are GMT +1. The time now is 07:47 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"