Forum Discussion
VBA code becomes inoperable, then "disappears" in 365
Nov 2022: VBA on a single sheet, small amount of code. Just clears content in specific cells when other cell values change.
I have been in the workbook and closed it. Opened it an hour later and voila the above just happens. Spent an hour with Crit Support on this and there does not seem to be a fix. If you have the problem and do an Excel repair to a version with a working VBA, it actually initiates the dysfunction & code removal.
Only solution I have found (w help of crit support) is to
- Copy your code to a notepad so you can access it ongoing at need
- Save your xlsm (macro enabled) as an xlsx (non-macro enabled)
- Reopen the new workbook and go to the sheet that needs the code
- Right click on the tab, select "View Code".
- Copy your code from the Notepad and paste into the VBA code screen
- Save and you will be prompted to save as a macro enabled sheet. Do so.
I hate having to do this but was not able to find a coding flaw or any issue that would cause this challenge and the Crit Support guy was super good and knowledgeable.
I had to do a rinse/repeat a number of times in Nov and early Dec. Then the issue just went away.
If you encounter this problem the above works, though as noted is very cumbersome. No idea why it stopped happening but always good to be prepared if so.
Hope this can help.
- ppattersonCopper Contributor
We have had this same problem since early December. My solution to this problem is to right click and restore a previous version of the report. Usually, a version a week back works well.
Does Microsoft actually care? we've reported this and crickets... With VBA not available in the on-line version, we are suspecting that they want everything moved to their new Scripts, which is sub-par but competes with Google Sheets.
VBA/RAC. Visual Basic for Applications/Randon Act of Corruption.
Have I thanked Uncle Bill lately? The world wants AI, but the same folks doing that can't get this right... so there is ZERO trust!