Variable not defined errors with Excel update 2212 dated 04 January

Anonymous
2023-01-10T05:15:10+00:00

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.

0 comments No comments
{count} votes

19 answers

Sort by: Most helpful
  1. Anonymous
    2023-01-12T10:18:59+00:00

    Hai Dan, we're facing similar issue's, basically causing all our engineering spreadsheets not to work properly anymore and even crashing on loading.

    I've been able to fix one spreadsheet which had an issue with forms opening by adding the scripting runtime reference in VBA. However this is no way to go as we have massive number of spreadsheets stored in our projects and VBA is password protected.

    Where can we get the 2211 version ?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-01-12T10:31:15+00:00

    i am also getting same issue .. what is the solution for this.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-01-12T10:42:33+00:00

    I am also getting the compile error but I am using .xlam addin

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-01-12T15:02:29+00:00

    I'm sorry you're running into this problem. Your temporary solution might offer some insight into the underlying Excel VBA issue. The only fix that I'm aware of is to roll back your Office version. The link below is to Microsoft's instructions for rolling back Office to a previous release.

    To use the method, you need to know the exact version you want to roll back to. Unfortunately, this varies slightly depending on your version of Office. There is a link to the enterprise releases version numbers in the link below but when I used it, I got an "Oop, something went wrong" error. The rollback number I used for my Home version of Office 365 was 16.0. 15831.20190. I've provided a different link to the Office release notes with version numbers that are slightly different from those in the link from Microsoft. You'll have to decide which one to use. No harm if you use the wrong one, you just get the Oops error. Once you've completed the rollback process, you'll need to disable the automatic updating, or the latest release may reinstall.

    One last note, when I went to look at the update release numbers again, I noticed that there is a 10 January 2212 release that has security updates. I don't know if it fixes the problem but this a new release since the 04 January 2212 version that was affecting us. I'm going to wait until the 2213 February release before I let Office update again just to be safe.

    Good Luck ..... Dan

    How to revert to an earlier version of Office - Microsoft Support

    Release notes for Current Channel releases - Office release notes | Microsoft Learn

    2 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2023-01-12T15:53:33+00:00

    Thanks DanIreland,

    after rolling back to old version my code is working fine ... but can't ask users to keep update disabled.

    Thanks.

    3 people found this answer helpful.
    0 comments No comments