Forum Discussion
Runtime error 6 overflow with Dim Double. MacOS Catalina - Excel 2019 - VBA 7.1
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.
PeterGallinI have found a temporary solution of the mentioned problem:
Sub Test()
Dim a As Variant
a = 20.3
End Sub
- Stefan1635Dec 20, 2022Copper Contributor
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.
- FabioTMCaldasApr 14, 2021Copper Contributorthanks, it's solved the issue on Mac
- PeterGallinApr 14, 2021Copper ContributorI 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.)
- Andrew_Duncan54Sep 05, 2023Brass Contributor
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 SubThis 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.