Protection property inadequate?

tonyBruckner

New Member
Joined
Apr 18, 2002
Messages
21
I'm writing a program for schoolkids and don't want them to alter any cells that are part of the assignment or to access VBA. The assignment involves clicking buttons that invoke macros. The macros change text in locked cells by deprotecting then reprotecting...

ActiveSheet.Unprotect
ActiveCell.FormulaR1C1 = "hello"
ActiveSheet.Protect

This is the wrong approach because of its drawbacks....
1) if a student tries to change a locked cell, a message box appears that tells him how to deprotect it.
2) a password option would be clumsy in a computer lab with 30 kids.
3) if the macro doesn't deprotect first, then a message box is invoked that gives students access to VBA (which they otherwise don't know exists) via the debug button.

Is there a way for a macro to slip a cell text change under the veil of protection without these message boxes?

And/or can the message box that explains how to deprotect the sheet be taken out or reworded?

Thanks in advance
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
And/or can the message box that explains how to deprotect the sheet be taken out or reworded?

Thanks in advance

I'm going for "or" on this one. Yes of course you can get rid of this messagebox. Open the Excel file, hit ALT+F11 do a search for the first two words in the messagebox (CTRL+F), making sure that you're searching the whole project (one of the option buttons)


Then delete the line that begins "msgbox".

HTH
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,253
Members
448,556
Latest member
peterhess2002

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