Fix Excel VBA Runtime Error 6 Overflow with Double Variables on Mac
Question details
The user is experiencing a VBA Runtime Error 6 (Overflow) specifically in Excel for Mac when declaring, assigning, or debugging Double variables, even though the exact same code executes without issues on Windows.

- Product
- Excel for Mac
- Device & OS
- Mac
- Scenario
- Running or stepping through VBA macros containing Double variables using the Mac VBA editor.
- Observed behavior
- The VBA debugger throws a 'Runtime Error 6: Overflow' inconsistently, often triggering specifically when stepping through the code line by line, but failing to run the affected lines.
Ensure your Excel for Mac is updated to the latest build, as Microsoft frequently patches platform-specific VBA bugs, and save your workbook to prevent data loss during macro crashes.
Run the Macro Directly Without the Debugger
Bypass the Mac VBA debugger, which is the primary trigger for this specific Double variable overflow glitch.
This error is often a false positive triggered specifically by the Mac VBA debugger evaluating Double variables. Running the code normally rather than stepping through it often allows the macro to finish successfully.
Save your code and close the Visual Basic Editor window completely.
Navigate to the Developer tab on the Excel ribbon and click on 'Macros'.
Select your target macro from the list and click 'Run'. Avoid using the 'Step Into' button.

Update Excel to the Latest Beta Channel Build
Install the latest Office updates or join the Beta Channel to receive the most recent bug fixes from Microsoft.
Try WPS Office for a Stable Spreadsheet Experience
Since Excel for Mac occasionally experiences platform-specific VBA debugger bugs, consider using WPS Office. It provides a highly compatible, lightweight, and entirely free alternative for managing your spreadsheets and daily tasks without the frustration of unexpected crashes.
- 1. Visit the Official Website: Go to the official WPS Office website using your Mac web browser.
- 2. Download for Mac: Click the 'Free Download' button to get the macOS installation package.
- 3. Install and Open: Run the installer, drag WPS Office to your Applications folder, and seamlessly open your existing spreadsheets.

Frequently Asked Questions
Why does my VBA code work on Windows but show Error 6 on Mac?
Excel for Mac uses a slightly different VBA compiler and debugger architecture than its Windows counterpart. Platform-specific bugs occasionally arise, such as the Mac debugger incorrectly evaluating Double variables, leading to this artificial overflow error.
What does Runtime Error 6 Overflow actually mean in VBA?
Generally, this error means a variable is being assigned a value that exceeds its data type's capacity limits. However, in this specific Mac scenario, it is often a false positive triggered by the debugger rather than an actual mathematical overflow.
How can I debug my code if stepping through triggers the error?
Instead of using the Step Into feature (F8) which triggers the bug, try inserting Debug.Print statements in your code to output variable values to the Immediate Window, or use MsgBox prompts to check values while running the macro normally.




