VBA & Macro Problems

Fix Excel VBA Runtime Error 6 Overflow with Double Variables on Mac

Aamir Naveed AkramAamir Naveed Akram Nov 3, 2026 869 views

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.

How to Fix Excel VBA Runtime Error 6 (Overflow) with Double Variables on Mac
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.
Before you start

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.

Solution 1Recommended

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.

1
Close the VBA Editor

Save your code and close the Visual Basic Editor window completely.

2
Open the Macros Dialog

Navigate to the Developer tab on the Excel ribbon and click on 'Macros'.

3
Execute the Macro

Select your target macro from the list and click 'Run'. Avoid using the 'Step Into' button.

Run the Macro Directly Without the Debugger
Debugging Alternative: If you need to check variable values, use Debug.Print statements to output them to the Immediate Window instead of stepping through with F8.
Free Microsoft Office alternative

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. 1. Visit the Official Website: Go to the official WPS Office website using your Mac web browser.
  2. 2. Download for Mac: Click the 'Free Download' button to get the macOS installation package.
  3. 3. Install and Open: Run the installer, drag WPS Office to your Applications folder, and seamlessly open your existing spreadsheets.
Fully compatible with Microsoft Excel (.xlsx, .xls) file formatsLightweight and fast installation on both Mac and WindowsFamiliar user interface with practically no learning curveCompletely free to use for everyday spreadsheet and office tasks
microsoft office alternative - wps office

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.