inserting this code would allow him to check whether or not protection is turned on and then perform a task based on whether protection is on or off.
however this still leaves him w/ no event to trigger the code and make it run. since there is not protect event, is there anything else that would work for him? This message was edited by kskinne on 2002-10-17 16:11
The only way I can think of in the absence of such an event is that you could replace the built-in Protect menu option with one of your own. The downside: this would "trap" manual protection, but not protection via VBA code, so if the user is determined to get around it he/she can.
Actualy the main reason for this is to be able to disable my add-in should the protection be enabled as it formats cells.
At the moment it has to check and reply with a message that the sheet is protected.
You can see the normal Excel format options go grey with protectin on so its in there somewhere guys (and girls), don't let Uncle Bill's boys beat us.
That functionality to grey out the boxes is in there, we're not disputing that. It's just that there's no event available to trap it and we can't create our own events or else there'd be madness in the world.
Thanks Corticus. I simply go by the rule of saying "no it can't be done" to everything, if I'm proved wrong then the solution provider is a genius.
not really what you probably want, but as a last resort perhaps you should trigger this code by a worksheet_change event or a worksheet_calculate event - that way if the protection was changed, as soon as the user does anything causing the worksheet to change or re-calculate, it would check the protection property, and run your code. like i said, it wouldn't be the ideal solution, but until you can come up with an alternative, it would do the job, albeit in a round-about fashion.