I can fix it just by opening and compiling , in O365, but a 32 bit version. I think the compiler is broken in O365 64 bit.
Word VBA Editor Compile and Crashing on Reset Problems

This is an issue that has been plaguing me for many months. It’s on a Word document with a VBA macro that I’ve been working on for literally about 20 years on all versions of Windows and editions of Word over those years. And it’s only recently this has started being a problem with the VBA system itself. I'm not sure if I just started hitting a limit with the size of my project or if its something else.
I frequently get an “Unexpected error (35010)” error randomly when compiling my project. Many times, I must close the Word document and reopen it to get it to compile properly. Sometimes if I wind up doing a few code changes it will start compiling again without errors without having to restart.
I get this seems like an internal memory issue with Word and the only resolution I’ve ever found so far is that increasing the virtual memory resolves it. But it’s not in my case. I’ve increased my virtual memory a couple times now and have my Initial size (MB): 15000 and Maximum size (MB): 30000
My last try was at what I saw recommended which was 8000 and 15000.
Running Windows 11 Pro 22H2 current build 22621.1702
16GB ram.
I’ve also exported all the modules and forms to text files to check the sizes. Most are very small in the low KB range. A few were up to about 600kb. I’ve broken most of those up now into smaller modules but that isn’t helping.
I have 330 forms (100 of those are just simple message screens with 3 subs and are about 20kb each). I am working on eliminating most of those help forms into a single data driven form hoping that reducing the # of forms may help. A few forms are between 400-500kb, a few are around 100 and the bulk are 50kb or less.
I have 61 modules, about 8 of them are in the 200kb range, about 10 in the 100kb and the bulk are in the 30-60kb range.
The 2nd issue and I’m not sure if they are related or not and this is a problem that has only been occurring for about the same amount of time that was never a problem for the first 20 years working on this code base.
The Word VBA editor has started terminating Word frequently when I click the “Reset” button to stop the execution of the macro. Many times, I also close the Word document when I’m done, and it will hang up for a while before it closes then reopens. Many times when I go to open the Word document it will fail to open.
Most of the time in these cases it will then want to open in Safe Mode, and usually I must delete the saved copies. Close the safe mode window. Sometimes I can get my document opened back up after a couple more tries. It usually first opens a recovery document or asks if I want to recover the data. There are 3 or 4 variations of what It winds up doing or asking. After a few rounds of opening and closing I will either get my document open or it is completely unusable and cannot be recovered or opened in Word 365.
When this happens, I must go over to an older computer running Word 2010, open the document which opens just fine every time, save it. Then I can go back to my main computer, and it takes 2 or 3 rounds of opening, deleting recover stuff/safe mode, but then it will finally open, and I can start working again.
This is getting frustrating enough I really need to figure out what is going on with the VBA editor.
I have uninstalled and reinstalled Office multiple times, it’s always patched to the most current version, but nothing is helping.
I did turn off Autorecover in the Word Save options because I don’t want all the autorecovery to kick in but there is something that is saving something somewhere that prevents me from just reopening my document on the same computer. The Word file itself seems to be fine as I can always open it on another computer using Word 2010 when its unrecoverable on my development computer and resaving it on another computer makes it work again on my dev computer.
Does anyone have any other suggestions?