I got an error when trying to open excel workbook:
var workbook = Workbooks.Open(filePath)
After that every time I've got:
Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)
What is interesting, when im using Thread.Sleep(2000) before "Open" function everything is working correctly:
Thread.Sleep(2000);
var workbook = Workbooks.Open(filePath)
Code is running on main thread.
Any ideas what should cause that behavior?
Thanks!
I fixed that issue.
Excel workbook was opening two times and each time I was calling releaseCom method.
User contributions licensed under CC BY-SA 3.0