Just a quick reply to let you know this worked for me and to tell you thank you so much for the help!
Variable not defined errors with Excel update 2212 dated 04 January
I'm an Excel developer and one of my customers started getting "Variable not defined" errors when opening an xlsm file that I provided. (All the flagged variables are definitely declared.) The macros in the file have run for years without any issues. Upon digging into the problem, it appears it started when update 2212 dated 04 January installed on his computer. He sent me the offending file and it ran fine on my computer. Comparing Excel versions, I found that my Office 365 installation had not updated, so I updated it and started getting the exact same errors. Digging further, I discovered that many of my other macro containing files were throwing the same error.
The error occurs when the VBA modules compile right when the file opens and runs the file open routine. Although the same variables are flagged each time, there does not appear to be anything unusual with those particular variables. In one file it actually flags a form control as not being defined. After stopping the compile process, Excel sometimes becomes unstable.
Long story short, it seemed to be related to the upgrade, so I chatted with Microsoft support, they rolled back the upgrade and we're no longer getting the errors. I was curious if anyone else had experienced this problem or something similar with the 2212 update. It only seems related to .xlsm files as far as i could tell, although I didn't do a lot of testing before rolling back the update.
Microsoft 365 and Office | Excel | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
19 answers
Sort by: Most helpful
-
Anonymous
2023-01-23T19:27:00+00:00 -
Anonymous
2023-01-23T19:38:34+00:00 @DGrafton,
I'm glad it helped. A lot of people are still limping along so hopefully this gets addressed at some point. I'm always amazed at the resourcefulness of people in these forums as they've helped me plenty of times.
-
Anonymous
2023-02-02T04:25:28+00:00 For those of you following this thread, it appears that the latest Offiice update (2301) has resolved the VBA error issue. I've only tested it on one computer so far but I was able to test a bunch of files that were throwing the error on 2212. They loaded and ran without any errors after the 2301 update was installed.
-
Anonymous
2023-02-02T15:18:42+00:00 For those of you following this thread, it appears that the latest Offiice update (2301) has resolved the VBA error issue. I've only tested it on one computer so far but I was able to test a bunch of files that were throwing the error on 2212. They loaded and ran without any errors after the 2301 update was installed.
Thank you for the update. And yes, I have been following the thread, hoping you or someone would let everyone know when or if Microsoft released a new update to Office since I turned off my updates when I rolled back to an earlier version. Again, thanks for all your help and knowledge and, most of all, your willingness to help the rest of us! Have a great day!