Lonk, you have too much time on your hands. [Wink]

Chris, could this be made more generic by (using Lonk's IIF code) by returning the input value if it is >= 0? Or do we never see a COM error return anything zero and above?

code:
Function fnConvertCOMErr($sErr)
Exit Iif($sErr<0,VAL("&"+Right(DecToHex($sErr),4)),VAL($sErr))
Endfunction

_________________________
Home page: http://www.kixhelp.com/hb/