Button on toolbar to lock/unlock code from edits
When working in the VBA editor, I oftentimes inadvertently insert a character into my code. Perhaps I do Ctrl+S to save, but, for some reason an S gets inserted. Or Ctrl+C or Ctrl+V. Oftentimes stray characters find their way in.
I'd like a button on the toolbar to lock/unlock code from edits. Code is initially locked when editor is opened. Nothing can be changed. If I want to edit code, I just click the button on the toolbar, do my edits, and then click it again when I'm done.
If the VBA editor is closed and reopened, the code is automatically locked again. Thus, when done with edits, one can just close the editor to relock the code.
Shawn Gordon commented
You can password lock the VBA code in the IDE, which should help you in that area. I would also think about writing a macro to export all VBA to a folder on click so that if you have an issue a rollback isn't as painful while also allowing you to edit in VS Code using a diff extension so that you can get a better handle on random characters and so on. Also, I suggest RubberDuck for VBA. That should help you refine your workflow and avoid inserting random characters, but sounds like keyboard shortcuts are not something that serves you well.