Excel Interop: success of OpenXML() depends on filename

21 Views Asked by At

I have two empty Excel files, named error_1.xlsx and error_3.xlsx. comp.exe shows them byte-for-byte identical. Nevertheless, while opening them with .OpenXML(), error_3.xlsx opens successfully, but error_1.xlsx causes .OpenXML() to fail with HRESULT 0x800a03ec. By experimenting with changing file contents and names I have proven that the result of .OpenXML() depends solely on filename. I access Excel via the COM interop interface from the server-side of an enterprise system, running from a non-interactive user account.

I have not been able to reproduce this error while invoking .OpenXML() from a test C# program from my own Windows session, which means that it is connected with the user-specific context. Since I have no idea how to reproduce the problem outside my environment, I can only demonstrate it via some kind of screen-sharing session (should you be so kind).

I conjectured the problem could be in some cache and temp files, but tracing filesystem events from excel.exe with Process monitor did not help.

0

There are 0 best solutions below