Function HexDecode(strText) 'As String Dim strBuffer, strGoodText 'As String Dim lngPosition 'As Long For lngPosition = 1 To Len(strText) If InStr("0123456789abcdefABCDEF", Mid(strText, lngPosition, 1)) <> 0 Then strGoodText = strGoodText & Mid(strText, lngPosition, 1) End If Next For lngPosition = 1 To Len(strGoodText) Step 2 strBuffer = strBuffer & Chr("&H" & Mid(strGoodText, lngPosition, 2)) Next HexDecode = strBuffer End Function Function HexEncode(strString) 'As String Dim strBuffer Dim lngPos For lngPos = 1 To Len(strString) strBuffer = strBuffer & Right("0" & Hex(Asc(Mid(strString, lngPos, 1))), 2) Next HexEncode = strBuffer End Function