How to convert extra long strings into their equivalent Hex Strings in VBA (Word 2K)



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
.



Relevant Pages


Loading