"Bob Butler" <bu*******@earthlink.net> wrote in message
news:fa*************************@posting.google.co m...
"Dan E." <fo********@twcny.rr.com> wrote in message
news:<Qt*******************@twister.nyroc.rr.com>. ..
Hi All,
A small elaboration of Bob's nice method:
Private Type bybytes
b(0 To 7) As Byte
End Type
Private Type bydouble
f As Double
End Type
Private Function Convert(HexDouble As String) As Double
Dim bdata As bybytes
Dim fdata As bydouble
Dim n As Long
If Not IsNumeric("&H" & HexDouble) _
Or Len(HexDouble) <> 16 Then
MsgBox "Bad dog."
Else
For n = 0 To 7
bdata.b(n) = Val("&H" & Mid$(HexDouble, n * 2 + 1, 2))
Next n
LSet fdata = bdata
Convert = fdata.f
End If
End Function
Private Sub Command1_Click()
Const Source As String = "000000000098C13F"
MsgBox Convert(Source)
End Sub