Forum Discussion
Worksheets("xx").Activate - breaks macro
Thank you for the suggestions. I ended up having to copy the data to a file I saved the previous day (Friday) and everything worked ok. I saved over the file that had the issues. But, I opened up the other file that was corrupted (somehow) and tried a couple of your suggestions.
First, I made sure macros were enabled. That didn't change anything.
Second, I inspected the workbook. It showed "macros or vba code found". But, again, I pulled up "Show macros" and nothing was there. I tried editing in VBA editor and found nothing as well.
Lastly, I just tried to save/close and I get this error:
"Errors were detected while saving "<filename>". Microsoft Excel may be able to save the file by removing or repairing some features. To make repairs in a new file, click Continue. To cancel saving the file, click Cancel"
When I click continue, I try to save as a different filename - that doesn't work. Then it doesn't want to close (clicking the "x").
When I finally can close it (I couldn't repeat the error today) it says something like - "a version was saved to Apps/Roaming/Excel....(generic default folder)." But, even that file doesn't include any of the changes I made (data added during the session) and has removed pretty much all formulas.
I guess, I was able to get around the issues by recreating the files from an earlier version. But, I would love to be able to figure out what caused it to crash like that - so I can avoid it in the future. And, I didn't click on any random links from a Nigerian prince, so I'm pretty sure that's not it. 🙂
The only saving grace is that I have a template for this other file since it is a weekly file. I created the new week file from the template without issues.
Sometimes antivirus protect i.g. defender will cause this problem and system region setting.