I put a breakpoint at the SaveAs but the debugger refuses to step into the SaveAs Code. Howver the error message becomes a bit more detailed:
Exception at 0x7ffed5634fd9, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in TKCDF!LDOMParser::getDocument