; MsgBox ErrorMsg(rtn) ''''display the error End If End If rtn = RegCloseKey(hKey) ''''close the key Else ''''if there was an error opening the key If DisplayErrorMsg = True Then ''''if the user wants errors displayed MsgBox ErrorMsg(rtn) ''''display the error End If End If End If