Multiple *.xlsm files no longer recognize attached VBA modules and files are uneditable/unsaveable.

Copper Contributor

This began with Excel 365 version 2307 some months ago, and got considerably worse with version 2312.  It used to be two or three times a week, but now it is happening three or four times daily.  Before, I just lost the VBA modules (which I learned to export, then I could save the file as *.xlsx and import the modules, resave as *.xlsm and keep on working.  Now Excel is crashing daily and leaving me unable to save Excel *.xlsm files in ANY format!  After the crash I reopen the file and the modules exist but I can neither see into them nor export them, and I cannot save the file nor repair it (rather, Excel repair always fails).  This happens with files I have used for years and for files I just created today. 

The only suggestion I found on-line was to rename the file as *.zip and re-rename as *.xlsm, which did not work.  I've started making daily backups but I lose a lot of data each day, and sometimes the previous day's backup crashes, too! ANY help would be appreciated.  

6 Replies

After the crash I reopen the file and the modules exist but I can neither see into them nor export them, and I cannot save the file nor repair it (rather, Excel repair always fails).

I guess the defender may result it.
If you want to avoid it occurs again,I guess you need close the defender anti-virus when.you open .xlsm file next time.


As to the VBA module,if you have backup, just restore it.

If you want to extract the Vba codes from the file you can not see,you can upload your .xlsm file,let us see whether it is possible to export those VBA modules as text.

@peiyezhu I am already exporting the modules as *.bas and have already doubly backed up some as text.  The problem is that the *.xlsm file is now useless (un-repairable).  I am losing one to three files DAILY and have to TRY to re-enter all of the data I lost since the last save.  Some of the larger files I am backing up to *.xlsx then importing the *.bas and resaving as *.xlsm (but even that does not work all of the time as the "new" *.xlsm opens as un-editable/un-repairable.

P.S. It's not as if I am changing the VBA code, some of these files have worked faithfully for years, some are new with new codes. I have even tried copy/paste from a backup into a new blank file, but Office 365 appears to hate *.xlsm on Windows 10 (and no, I cannot update to 11 yet until the company does (probably in 2025).
P.S.S. ESET anti-virus installed by the company, cannot be turned off.
How about VBS(visual basic script) instead of VBA?
I spent some time on it, will be very difficult (Interacts with Internet, Excel files on our company's server, and MS Word), and then I found this... https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features-resources. VBScript won't be around more than a few years.