Jan 16 2024 07:28 PM
My macros are disappearing. It seems to be random. There are several tricks I can use to get them back, but the problem keeps coming back.
Jan 17 2024 01:02 AM
The disappearance of macros in Excel can be caused by various factors. Here are some common reasons and solutions:
If the issue continues to occur, you may need to provide more details about your Excel version, operating system, and any specific error messages you encounter. Additionally, checking the Excel event logs might reveal more information about the disappearance of macros. The text was revised with the AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
Jan 17 2024 11:14 AM
Jan 17 2024 11:31 AM
Feb 16 2024 10:28 AM
@Perry320 We have been having the same issues with all our users. Restoring the file to a previous known working version is the easiest solution. Today, 2/16/24, we are testing having some users move to Office 2021 LTSC to see if its an issue with Office 365.
Feb 16 2024 02:31 PM
I didn't post this on the main thread because I had no absolute answer. Here is what happened: I discovered an icon on my screen that I didn't put there. I checked my downloads and there it was. I could shoot myself for not making a note of what it was, but I didn't. I deleted it. Since I did that not ONE of my macros has disappeared. Not a single problem. I'm not 100% sure it was that download... but... awfully big coincidence if it wasn't. Like I said, since I wasn't sure of anything, and didn't remember the name of the download, so I didn't want to post a response. @Nevin930
Apr 02 2024 06:51 AM
@Nevin930 I have the same thing happen with my macro-heavy workbooks, and it's gotten so bad that I am constantly saving backup versions to date-coded folders (with descriptions of any changes) cos this problem is arbitrary, chronic, and infuriating. In some cases, my previously-fine backups (I always check to see if the macros are there with [ALT]-[F8] before closing) are likewise corrupted. This has been going on for years, and the "just back up every new version" has become the only way to save my work from total Excel annihilation.
Apr 02 2024 09:36 AM
It's April 2, and I still haven't had one macro disappear. Since my last post, I have discovered another workaround. Buttons. I was able to get rid of 26 macros on one file by using option buttons. On another file, radio buttons. But I still have a couple simple ones, and they haven't vanished. I MIGHT have remembered the icon that mysteriously appeared on my computer: One Drive. I'm not sure, but I saw the icon somewhere, and it struck a cord. Good luck. I was on the brink of giving up a project I had been working on for a year because of this problem.
Apr 02 2024 11:12 AM
@Perry320 mine are data-intensive crop-yield modeling workbooks that are linked to databases for weather data, crop yield data, and satellite vegetation health data... so I am sure I am pushing Excel to the limits. But I am also the only person in our office this keeps happening to. It just happened now, and the previous two versions of the workbook I backed up, which worked fine when I backed them up, are likewise f___ng corrupt and now useless. This sends me to a dark, angry place. I suspect there is either a DLL file or something within my MS Office or Excel that is corrupt. Our IT has already wiped my MS office clean and reinstalled it, and that doesn't seem to have stopped the problem. I am really at my wit's end.
Apr 04 2024 01:23 PM
I think you might be on to something with One Drive. I think One Drive is trying to push itself to be used too much, and when saving, it glitches and doesn't save completely or is still processing or something and becomes read only, which clears the macros.
There's some scuttlebutt on here about EXD files being the problem, but I wonder if it's just coincidence:
http://www.lessanvaezi.com/delete-exd-files-to-fix-object-library-invalid-error/
Apr 04 2024 01:52 PM
Apr 09 2024 02:35 PM
Apr 09 2024 02:45 PM
@bhs67 I feel your pain. Do the macros not work at all? Are they there when you hit ALT-F8?
If they are there and sometimes work, then my advice: Keep date-coded backup folders, and back them up frequently. Yeah, a pia, but this has saved me a ton of aggravation and F Bombs.
If they don't work at all, then sorry... no ideas.
Good luck.
Apr 09 2024 03:13 PM
Apr 09 2024 03:50 PM
Apr 21 2024 08:39 PM
@Perry320 I had this exact issue and have been looking everywhere to try and solve as none of the provided solutions helped me. BUT what did help me was removing any sorting applied to the data. Don't ask me why, but as soon as I removed any 'sorting' in the data the macros reappeared and worked again.
Aug 26 2024 10:55 PM
@Perry320 Here is what worked for me, My excel files would not show my macros. Closed excel, restarted and opened by Personal.xlsm file. It showed my old macros under view macros.
I added some to my quickview ribbon. Left personal.xlsm open.
Opened other excel files and they now show my macros and the ones added to quick view.
No idea why this worked. But it did.
Aug 26 2024 11:27 PM
I haven't had a reoccurrence since I zapped the program I mentioned above. But yours is a simple solution I will definitely keep in mind. Thanks.
Aug 27 2024 03:42 AM
@Perry320 @Douglas Cortez thank you for the responses. I figured it out a few months ago.
I have an Export macro that exports several charts as PNGs as well as a data sheet as a CSV. It turns out this macro (I think it's the CSV portion) was -- on occasion -- corrupting my files. My solution: Save the XLSM, run the Export macro, then close without saving. This has worked like a charm!
If I had to guess, it's the Export CSV portion of the code that ultimately corrupts the file. But I need both the PNGs and the CSV to support other work, so I have learned to not save the file after running the macro.
FWIW.