blocking unprotect popup

JoeS01

Well-known Member
Joined
Jun 25, 2005
Messages
832
I have a protected worksheet showing results of users maths tests. When users try to add data to this worksheet, a Windows Office window appears, advising it is a protected sheet, then gives instructions on how to Unprotect it.

I do not want users unprotecting this particular worksheet.

Can anyone please advise a VBA routine tro prevent this popup appearing?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
When you protect, add one line

Sheets("yoursheetname").EnableSelection = xlUnlockedCells
 
Upvote 0
Sorry jindon, but that does not work as required. If I double click anywhere on the protected sheet, or hit a key stroke, then the Microsoft Excel message window pops up.

would you have any other suggestions ?
 
Upvote 0
Sorry jindon, but that does not work as required. If I double click anywhere on the protected sheet, or hit a key stroke, then the Microsoft Excel message window pops up.

would you have any other suggestions ?

Will you be able to tell the exact message the popup shows? I guess you have a protected sheet without a password and whenever the user tries to enter something you have a popup.Try unprotecting the sheet saving it and re-opening the same.
 
Upvote 0
You need to make sure tat any cells that require entries are unlocked, then add a password to the worksheet protection. That way only users with the correct password will be able to edit the sheet.
 
Upvote 0
Sorry jindon, but that does not work as required. If I double click anywhere on the protected sheet, or hit a key stroke, then the Microsoft Excel message window pops up.

would you have any other suggestions ?

Do you have sheet event driven code on the sheet module?
 
Upvote 0
thanks Storm seed, but that did not work either.

You are right in that I have a protected sheet without a password.

I have also tried 'Application.DisplayAlerts = False' without success
 
Upvote 0
Roy, it is a bit more complicated.

After users do their test, and hit a Reset button, VBA code unprotects the Results worksheetsheet, update the results, then protects it again. The addition of a password makes this not possible , unless VBA handles the password internally without manual intervention.

Would you have any suggestions please?
 
Upvote 0
Joe

In code this would be:

Code:
Sheets("Results").Unprotect "YourPasswordHere"
...do stuff...
Sheets("Results").Protect "YourPasswordHere"

If you apply a password to your Visual Basic Project, then users won't be able (easily) to derive what the password is.

Hope this helps!
 
Upvote 0
Many thanks Richard, and to all other helpers. Richard's suggestion worked, except the format is as shown, wioth brackets around the password.

I was unaware that Excel VBA would handle a password

Code:
Sheets("Results").Protect ("YourPasswordHere")
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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