Re: How to convert extra long strings into their equivalent Hex Strings in VBA (Word 2K)
- From: "Henning" <computer_hero@xxxxxxxxxxxx>
- Date: Wed, 14 May 2008 19:22:21 +0200
<zeGenius@xxxxxxxxx> skrev i meddelandet
news:aad67719-4c38-44ba-a577-feeadc36269c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi there,
I have an interesting problem. I am trying to write code in VBA (Word
2K) wherein I have to convert a string-representation of really large
numbers (upto 18 digits max) into its equivalent Hex String
representation
e.g. ConvertNumberToHex( "999999999999999999" ) => "DE0B6B3A763FFFF"
I have no problems as long as the number being passed to the function
is less than the max allowed by the Long Type in VBA (Word 2K) viz.
&h7FFF FFFF = 2147483647. But, when the input is larger than this
number, I get overflows.
Trying the Hex() or Val() also results in overflows when the input
number exceeds &h7FFF FFFF
Any ideas how to perform this function easily in VBA (Word 2K)?
- Neil
Don't know what types are available in vba, but in VB you could use the
Decimal type.
As:
Dim MyNum As Variant
MyNum = CDec("999999999999999999")
/Henning
.
- References:
- Prev by Date: Re: Revisit Shell Function
- Next by Date: Re: Writing an XML file to sharepoint using VBA in excel
- Previous by thread: Re: How to convert extra long strings into their equivalent Hex Strings in VBA (Word 2K)
- Next by thread: Re: How to convert extra long strings into their equivalent Hex Strings in VBA (Word 2K)
- Index(es):
Relevant Pages
|