Disabling Worksheet Protection Warning Message Vs DisplayAlerts=False .. (Oddity)

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,621
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

As you may all know, setting DisplayAlerts=FALSE doesn't prevent the warning message from poping up when attempting to edit/modify a protected worksheet.

The only two hacks that I know of are either using a Windows Timer or installing a CBT Windows hook that monitors the application for any window that is about to be created via the HCBT_CREATEWND Hook ID.

Unfortunately,although these two methods do work for stopping the sheet protection popup, they have problems of their own which outweigh their benefits .

Recently, By mere accident, I noticed that if you reset the VB Project by going to the VBE, clicking on the debugger Stop Button then pressing the Reset Button and finally executing Application.DisplayAlert=False in your code, if you follow these steps then the Sheet Protection waring popup no longer shows up and DisplayAlerts=False seems to take effect !

I don't know if this just the case with the excel edition that I am using (Excel 2010 64bit) but you can try it with your own and see if it is the same.

I just thought I would share this excel/vba peculiarity with you here but, at the same time I am hoping this might be a clue to how this can be accomplished in case anybody can build up on this and mke it work obviously without the need to programmatically (and brutally) reset the VBE as that would cause other serious issues such as losing variables,dealing with the VBE security restraints ... etc .

Regards.
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,231
Messages
6,123,754
Members
449,119
Latest member
moudenourd

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