How can I prevent Excel for mac from corrupting VBA on several worksheets?

Jim Beaupre 40 Reputation points
2025-07-31T18:44:09.0133333+00:00

VBA macros aren't working for multiple runs after the recent update to Excel 16.99 for Mac. I use an M4 iMac, MacOS 15.5.

After a successful Excel VBA execution, when I rerun the Excel VBA code I get error #6, overflow. With nothing changed if when I close and restart Excel and rerun the VBA macro, the same error occurs. When I restart the computer everything is sometimes OK, for the 1st execution.

The issue doesn't seem to be specific to a single workbook, but to several workbooks I've tried.

What does work for a single execution is to reset Excel to it's original state with Microsoft Office Reset.

Example error:

z1 = Cdbl(f(k)) <-- Overflow ERROR, but both z1 & f(k) have valid values.

f(k) is an Array variant, z1 as double

I can get correct answers if after this error I click "debug" and "continue" and work my way to completion with repeats of that manual process for all similar errors.

  1. Does anyone else have this problem?
  2. Any ideas on what's going on?

Here's what I've tried...with no success:

1. Using option explicit and adding required Dim's

2. Reinstalling Office (only 1st execution is good)

3. Avoiding use of Array data definition

4. Forcing a double: z1 = Cdbl(f(k) +0#)

Microsoft 365 and Office | Excel | For home | MacOS
0 comments No comments
{count} votes

Accepted answer
  1. Xavier-D 630 Reputation points Microsoft External Staff Moderator
    2025-07-31T23:43:19.8833333+00:00

    Hello Jim Beaupre,

    Welcome to Microsoft Q&A

    Thanks for sharing your solution. It seems like Excel version 16.99 is not working properly and corruption VBA on multiple worksheets.

    Your solution of rolling back to a working version of Excel is a great idea, especially since it points to a possible problem with the recent version of Excel. This kind of detail is extremely helpful for others who might run into the same situation. I appreciate you taking the time to come back and post the fix.

    If you want to make sure this gets visibility or share your feedback, you can use the Feedback Hub on Windows or the Microsoft Feedback Portal:

    https://feedbackportal.microsoft.com/

    Best Regards,

    Xavier-Microsoft Q&A Support Specialist.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Jim Beaupre 40 Reputation points
    2025-07-31T21:19:57.4433333+00:00

    The answer seems to be to revert to an earlier version of Office.

    I went from 16.99 to 16.78.

    Office 16.78 works


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.