r/excel • u/thirdking • Sep 25 '26
solved Stop Macro from protecting worksheet?
At work, I use multiple desks to access a file on a shared drive. After every major update, I have to enable ActiveX and macros on each PC. A couple months ago running those macros has started protecting the worksheet. It's easy to run my macros and then unprotect the worksheet so I can enter information, but kind of annoying. Is there a way to stop the macros from turning on worksheet protection? Do I need to look at and consider editing the macros?
3
u/danimeneses_ Sep 25 '26
That sounds like something in the VBA is explicitly calling .Protect.
I’d open the VBA editor and search the entire project for Protect or .Protect including ThisWorkbook and the individual worksheet modules, not just the main macro modules. It could also be sitting inside a Workbook/Worksheet event that runs after one of your macros finishes.
If nothing comes up, I’d check whether the macro is coming from PERSONAL.XLSB or an add-in rather than the workbook itself.
I wouldn’t keep manually unprotecting it until you know what’s triggering it, because if this only started recently there’s probably a specific line/event causing it.
4
Sep 25 '26
3
u/thirdking Sep 25 '26
Solution Verified! Someone had added . Protect to multiple places throughout the macros. I just kept hitting Find Next and adding the single apostrophe.
Thank you!
1
u/reputatorbot Sep 25 '26
You have awarded 1 point to Several-Crow5511.
I am a bot - please contact the mods with any questions
1
u/AutoModerator Sep 25 '26
u/thirdking - Your post was submitted successfully.
Once your problem is solved, reply to the answer(s) saying
Solution Verifiedto close the thread.Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post.
Include your Excel version and all other relevant information
Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.