Runtime error 6 overflow with Dim Double. MacOS Catalina - Excel 2019 - VBA 7.1

Copper Contributor
14 Replies

@isabelaj

 

Hi,

 

Please provide some useful info about the problem! 

The visible part of the code in the first screenshot doesn't seem to have an error!

 

However, the Overflow error is one of the most popular runtime errors in VBA, please check out this documentation article to learn more about it and how to fix it.

 

Regards

@Haytham Amairah 

I have exactly the same problem as isabelaj: When I declare a variable as double I cannot assign any value to that variable. It results always the overflow error message.

@PeterGallin

 

A similar problem is discussed here in this link.

@Haytham AmairahThank you for your answer. But my problem is not the same because I receive the error message of overflow even with that little program:

Sub test()

Dim a As Double

a = 20.3

End Sub

Error message in the third line.

As I read in an other chat, this program runs well on a Windows Computer but not on the Mac.

 

@PeterGallin

 

I've tested your code in my Windows machine, and it works without errors!

It seems that there are some issues related to the Mac version of Excel.

I think this thread would be more helpful!

 

Regards

@Haytham AmairahThank you again for your test. I am shure now that there is a problem with Excel on Mac and even the newest version on an brandnew MacBook 12". I had a chat with a Microsoft Expert yesterday and he promised me to contact the developpers so that there will be the solution in the next update. I hope ...

@PeterGallinI have found a temporary solution of the mentioned problem:

Sub Test()

Dim a As Variant

a = 20.3

End Sub

 

thanks, it's solved the issue on Mac
I am surprised that such a long time there is an answer on my problem. But now I would like to know how the problem is solved. Is there a new update for Microsoft Excel? (I do not want to change the operating system on my mac.)

@PeterGallinyou made my day.

This is one of the "Traffic-light" errors ("On-Off-On-Off") that  escort us thru Office Versions on MacOS since 2004. If you think some version is clean, the next update brings the bug back.

 

For chinese characters to be displayed correctly in formula results, it took MS from Office4Mac2004 (2005) to Office 365(around 2020). They are only 200 developers there, so be patient. But they finally will do it. :-DDD

@PeterGallin 

 

Same problem is occurring with MacOS 13.5.1, MS Excel for Mac 16.78, Office 365.

Sub test2()
    Dim a As Long
    Dim b As Long
    
    
    a = 0
    b = 10
    Debug.Print a; b
    a = b
    'a = Round(b, 10)
    Debug.Print a; b
End Sub

This generates a Run-time error '6'. If the type is changed to any other numeric type the problem does not occur. If the to be assigned variable is processed by a function such as Round (see comment line in code) the error does not occur.

@PeterGallinHaytham Amairah , I have the same (run-time error '6' overflow) when I open WORD....

Capture d’écran, le 2023-11-09 à 15.35.57.png.

... it seems to happen only when Excel is opened (but not necessarly running). I red the answers and flow the links but didn't find answers to my situation. 

I'm using a MacBookpro 2019 with Sonoma 14.1.

 

Can someone could explain to me what's happening and what to do... in a way understandable for a not-so-knowing-informatic-technicallity person (specifically I'm not used with coding and using the terminal... But I can learn)?

 

Thank you, best regards

With Excel 365 Mac, I subscribe to the Insider program/Beta Channel. I found the problem went away with the next incremental upgrade. So, it appeared to be a temporary MS Excel problem.