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-18T13:39:08+00:00

    @Developer PM,

    Thanks for posting. With my files the problem occurs with both the 32 and 64-bit versions. We've used the VBA cleaning described in my post above and it seems to be working, I originally tried just exporting and re-importing forms/modules but that only fixed one file. I had to use the more thorough process of removing all the code and saving the file as .xlsx, then re-copying the code to fix the other file. I've been doing a lot of testing and currently have about a dozen users testing cleaned versions of the file and so far, I've only had a couple reports of issues, but they're not the same issue and may be unrelated. Interesting though, both the users with issues have the 32-bit version. I've got a lot more users who will be affected whose computers haven't updated. I still have two computers that haven't updated yet.

    If you get any answers from Microsoft, please post back here.

    0 comments No comments
  2. Anonymous
    2023-01-20T21:14:04+00:00

    Have a question regarding your fix.

    Do I go to a command prompt and change directories back to the C: prompt, then type in "C:\Program Files\Common Files\microsoft shared\ClickToRun\officec2rclient.exe" /update user updatetoversion=16.0.15831.20208

    I'm not a programmer but really need help on this. I'm a bookkeeper and Quickbooks will not allow me to send my Certified Payroll Report to Excel due to a module error. I believe this roll back will fix the issue since I just started having it with the Office update.

    0 comments No comments
  3. Anonymous
    2023-01-20T21:22:26+00:00

    @DGraton,

    You shouldn't have to change the directory. Just run the command prompt as an administrator and you should be good to go as long as you have a click-to-run version of Office.

    Good Luck - please post back her if that solves your problem.

    0 comments No comments
  4. Anonymous
    2023-01-23T17:12:55+00:00

    I did get an answer from Microsoft support. They are aware of the issue. And my interpretation of their response is that it is likely that a fix will come our way but no timeframe is given.

    For now rolling back to previous version is the work-around.

    0 comments No comments
  5. Anonymous
    2023-01-23T17:21:14+00:00

    @Developer PM,

    Thanks for the update. I'll be optimistic and hope for a fix in the next release.

    0 comments No comments