actually, if you want to keep it backwards compatible (without iif):
code:
Function fnCOMErr($lErr)
If $lErr<0 Exit VAL("&"+Right(DecToHex($lErr),4)) EndIf
Endfunction

_________________________
!

download KiXnet