Sicos1977 / IFilterTextReader

A reader that gets text from different file formats through the IFilter interface
Other
55 stars 38 forks source link

Cannot read text from .xls #49

Closed andreas-eriksson closed 1 year ago

andreas-eriksson commented 1 year ago

.xls files stops working when upgrading from 1.5.4 to 1.7.7

using (var reader = new FilterReader("c:\\f.xls"))
{
    return reader.ReadToEnd();
}

This code throws an exception in the new version. System.Runtime.InteropServices.InvalidComObjectException : COM object that has been separated from its underlying RCW cannot be used.

Is there anything I can do to get it working again?

f.xls

andreas-eriksson commented 1 year ago

I think the change of behaviour was introduced in 4c1a92710f54ed2ef9c68e92afc37891385c5fa6 as I fixed the same error in the commit before. https://github.com/Sicos1977/IFilterTextReader/commit/b7cbfb64741cc5091088c7964dcf00aeb76883ce#diff-98f8d2a52cc406bf5b2217e1262af63e842568fead3552cdce102714332b195b

Sicos1977 commented 1 year ago

Let me check the code with your file to see what kind of error I get... give me a minute

Sicos1977 commented 1 year ago

Did you get this as an error? COM object that has been separated from its underlying RCW cannot be used.

Sicos1977 commented 1 year ago

There seems to be something wrong with the file, when I open it in Excel and save it again it works without any problems

Sicos1977 commented 1 year ago

Fixed... just get the latest nuget package

andreas-eriksson commented 1 year ago

Thanks for fixing this 👍