Re: Overflow



Thanks you very much.

The problem is solved.



Best regards

Erik





"Andrew Taylor" <andrew.taylor@xxxxxxxxxx> wrote in message
news:1134467913.086674.253440@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> The problem is that VBA tries to calculate
> 162 * 207 as an Integer, and then convert
> to the result to a Long. The first of these
> steps causes the overflow. You can get
> round this by forcing one of the values
> to be a Long:
>
> ll_test = 162& * 207
> or
> ll_test = CLng(162) * 207
>
> Note that ll_test = clng(162 * 207) will fail,
> for the same reason as in the original problem.
>
>
> Andrew Taylor
>
>
>
>
> Erik Beck Jensen wrote:
>> Excel 2003 SP2
>>
>> Hello every body
>>
>>
>> This little sub gives me a runtime overflow. Did I miss something?
>>
>>
>>
>>
>> Sub ebj()
>>
>> Dim ll_test As Long
>>
>> ll_test = 162 * 207
>>
>>
>> End Sub
>>
>>
>>
>> I would have expected ll_test to take a value = 33,534. A Long should be
>> sufficient to hold that. If I change the declaration to Single or Variant
>> I
>> still get an overflow.
>>
>>
>>
>> Any suggestions?
>>
>>
>>
>>
>>
>> Best regards
>>
>> Erik
>


.



Relevant Pages

  • Re: Word spelling
    ... > Hi Erik, ... > You'd need to purchase the Office 2003 Proofing Tools Kit. ... > Best regards ...
    (microsoft.public.office.setup)
  • RE: MS ACESS cannot open this file error (new uer)
    ... I have the same error and none of the fixes I've seen actually work. ... Regards, ... Erik ... "Sever" wrote: ...
    (microsoft.public.access.security)
  • Re: apache2 php4 AND 5 ?
    ... Erik @ Microcontroller.nl wrote: ... I'm now trying to change the mimetype in the php5 module.. ...
    (freebsd-isp)
  • Re: Error in Copying and pasting data
    ... "Erik BZ" wrote: ... > Sub Test() ... >> I commented these two lines and now I am getting the same error(Run tiem ... >> TIA ...
    (microsoft.public.excel.programming)
  • Re: CD Burner software
    ... + pc hangs when trying to make a cd during the burning process ... we use the latest version from the Binary Magics site with the latest ... > Hi Erik, ... >> Regards, ...
    (borland.public.delphi.thirdpartytools.general)