The Events of the Err object can only be used if a COM object reference variable with the class name TCEServer.ErrorObject has been created in a class and the Use Events switch of the variable is set.
More:
OnError Event (Err)