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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
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
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
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,214,615
Messages
6,120,538
Members
448,970
Latest member
kennimack

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
Back
Top