VBA Coding window highlights text red and then deletes
I am having a strange problem that I have never had before with VBA.
Whenever I try to type something in the main code window for anything (a Worksheet/Userform/Modules), as I type VBA keeps highlighting my code in red and if I stop typing VBA begins to delete what I just typed (usually one or two characters).
This is only happening for the workbook that I am currently working on, all the other ones are fine.
I just wanted to know if there was some setting that I accidentally hit that is causing VBA to do this.
I am using a lot of ActiveX controls which may be the issue.
Edit: I tried deleting everything of of my first worksheet code window and typed in a random three letters and hit space. It keeps popping up a window that says "invalid outside procedure." Windows keep popping up and I eventually just have to force quite (after 15-30 are on the screen and more are coming).
I also tried on another laptop and the same thing happened (with this workbook).
The deleting of characters issue, I wonder if you have a sticky keyboard perhaps?
The "invalid outside procedure" is generally when you have code outside of a standard sub routine. Check them and make sure this isn't happening. Can you post your code here?
This is the workbook containing the code that is messing up VBA.
I know the code is extremely messy (I'm just beginning VBA, this is just a project for class). I also couldn't comment on the code since VBA liked to delete it.
At least this will let you see what I am talking about.
Turns out that the error happened when I had some items run when VBA started. I deleted them when I uploaded the file so nobody would have to deal with them to get to the code, that's why nobody saw the problems. I stopped the processes that ran in the beginning and now everything runs perfectly.