LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A curious OVERFLOW problem


Has anyone attempted to perform 182*182 operation in VBA? The followin
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
as a variant either by default (no declaration) or explicitly (b
declaration) doesn't help either.

As 181*181=32761, which reminds one of the magical figure 2 ^15 ther
must be some connection here.


What's happening ?


Myle

--
Myle
-----------------------------------------------------------------------
Myles's Profile: http://www.excelforum.com/member.php...fo&userid=2874
View this thread: http://www.excelforum.com/showthread.php?threadid=49208

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just curious famdamly Excel Discussion (Misc queries) 2 December 7th 05 01:33 AM
Problem with overflow Peter Excel Programming 1 November 2nd 05 06:34 PM
Just curious RedChequer Excel Discussion (Misc queries) 3 March 10th 05 11:15 PM
Overflow Problem D[_6_] Excel Programming 7 August 11th 04 06:06 PM


All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"