Closed holly-hacker closed 4 years ago
LinqToExcel doesn't support modifications to the file while it's open. So you should close the file prior to making the changes, and re-open it afterward...
But, regardless, it should not hang as a result of the exception you get. How are you performing the modifications? Programmatically, or by hand via the Excel application? This would be helpful to know so I can reproduce it.
Thanks!
I was modifying the Excel file by hand through the Excel program. I do think I tried closing the file before reading it again but I'll try again monday when I get back to work.
Ok, cool. Thanks for getting back to me.
I have gone through the following steps:
This still gives me the reported exception.
Any updates on this?
Sorry, no. I'll see if I can set some time aside this weekend to look into it.
I haven't been able to reproduce what you're seeing, but it could be related to connection pooling. Please add the following line right after instantiation, and let me know if that does/doesn't help:
excel.OleDbServices = OleDbServices.AllServicesExceptPooling;
I haven't opened this VM in a while, but I can't seem to reproduce it anymore either. It's most likely something that got fixed with an update to Windows or Excel. I'll reopen this issue if the issue returns and your suggestion doesn't fix it. Sorry for wasting your time.
I am using LinqToExcel v1.11.0 in an application that reads an Excel document, but modifying the document after having read it and then reading it again throws an exception:
If I try to open another document after that, the application hangs and I managed to capture the same stacktrace with dnSpy:
My code looks like the following
My application runs in a 64-bit Windows 7 Ultimate virtual machine. If I completely restart my application, it works again. I have tried switching to v2.0.0 pre-release 2, but the problem persists.