I'm getting an overflow on "CLng(octects(0)) * 16777216" but Longs support much larger numbers I thought?
VBA Code:
Public Function to_number(ByVal sInput As String) As Long
On Error Resume Next
sDelim = "."
octects = Split(sInput, sDelim)
to_number = CLng(octects(0)) * 16777216
to_number = to_number + CLng(octects(1)) * 65536
to_number = to_number + CLng(octects(2)) * 256
to_number = to_number + CLng(octects(3))
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Function
Sub test_to_number()
Debug.Print to_number("192.168.0.1")
End Sub