Alright, here's a hard lesson learned...
I had some issues with the Outlook integration, where my codeunit 5072 (outlook application management) still didn't compile after registering the new versions of the dll's. So, after a long time, I finally discovered which one is supposed to be the OLHandler automation server.
What I didn't realize, is that this automation server has events, and here's the tip:
When you reset an automation server that has events, Navision will also reset the events, and any code that you wrote inside those events will dissappear. So if you ever need to do this, just export your object as text first, so you can restore the code inside.