Turning Off Protection Alerts

elchupacabra

New Member
Joined
Oct 24, 2007
Messages
3
Hi all

Here's my problem: Is it ppossible to disable (preferably through vba) the alerts associated with a protected sheet?

For instance, if a user attempts to edit the contents of a locked cell in one of my protected sheets, the alert "The cell or chart you are trying to change is protected and therefore read-only" pops up.

I have a workbook containing 3 protected worksheets over which various macros can be performed (by using the Workbook_Open event to set the UserInterFaceOnly property to "False").

I have tried to include the following line in this very same Workbook_Open routine, but it doesn't disable the alert quoted above:

Application.DisplayAlerts = False


Really could do with some help, if you don't mind :p


El C
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

ZVI

MrExcel MVP
Joined
Apr 9, 2008
Messages
3,875
Office Version
  1. 2019
  2. 2016
  3. 2010
Platform
  1. Windows
Hi!

There is no standard way to avoid this message.
But you can switch off checkbox 'Select Locked Cell' at Protection of worksheet (ActiveSheet.EnableSelection = xlUnlockedCells) to avoid selection of protected cells as well as trying of editing it.

UserInterfaceOnly should be set to True (not to False as you wrote) for accessing to protected cells from VBA.

Regards,
Vladimir
 
Upvote 0

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Welcome to the Board!

Unfortunately there's no suppressing that warning.

But you may be able to get around that by setting the wb to Read Only, depending on what you're trying to do.
 
Upvote 0

elchupacabra

New Member
Joined
Oct 24, 2007
Messages
3
Thanks for the replies

Yeap, sorry, the UserInterFaceOnly property is in fact set to True.

Unchecking the "Select Locked Cells" as you recommended seems to have done the trick, so thank you very much for that.
 
Upvote 0

Forum statistics

Threads
1,191,183
Messages
5,985,169
Members
439,944
Latest member
Vangelis74

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top