Has anyone attempted to perform 182*182 operation in VBA? The following code generates an ovwerflow error in spite of the declarations.
Sub test()
Dim x as Long
x= 182*182 'overflow error on this line
Msgbox x
End sub
The problem persists even with a DOUBLE declaration for x. Treating x as a variant either by default (no declaration) or explicitly (by declaration) doesn't help either.
As 181*181=32761, which reminds one of the magical figure 2 ^15 there must be some connection here.
What's happening ?
Myles
Bookmarks