First Posted 2/29/24
Ever since I made this fix for both myself and had done for all 200+ PCs for my major client, the issue went completely away. People really need to read all helpful posts here.
VBA in Workbooks Stops Working With Upgrade to Excel 365-VBA Compiling Issue In my and my client’s continuing struggles with the extremely annoying Excel VBA file corruption issues (VBA code in workbooks stop working with upgrade to Excel 365), I think I may have found something new worth trying. See the Stackoverflow link below, with the relevant proposed solution printed out. I’ve just applied this change to my PC Registry, but I’m hesitant to recommend anyone else do this as I’m clearly no expert in making such PC system changes. https://stackoverflow.com/questions/69018012/vba-workbooks-stop-working-with-upgrade-to-excel-365-vba-compiling-issue I think I perhaps found an answer in this thread: https://lnkd.in/gU3E2bfG
Per that thread: “the cause is that Excel does not correctly save the compile state of the VBA code and 64-bit Excel cannot recover from that issue when opening the afflicted Excel file (32-bit usually can). A fix was released for only Excel 2016 and not for other versions". That would indeed confirm that it is a bug within Excel and explains why we only see the issue with 365 64-bit Excel.
That also explains why my manual compile fix works. Based on the article I found, there is a more sustainable fix. You can change Excel’s registry and force VBA to compile accurately.
To implement the permanent fix:
1. Open the start menu and type “reg” and select the “Registry Editor”. 2. Navigate to: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\options. 3. On the Edit menu, point to New, and then click DWORD Value. 4. Type ForceVBALoadFromSource, and then press Enter. 5. In the Details or Name pane, right-click ForceVBALoadFromSource (that you’ve just added), and then click Modify. 6. In the Value data box, type 1, and then click OK.