fsprojects / ExcelProvider

This library is for the .NET platform implementing a Excel type provider.
http://fsprojects.github.io/ExcelProvider/
The Unlicense
141 stars 51 forks source link

Allow reading Excel files that are currently open #81

Closed goswinr closed 3 years ago

goswinr commented 3 years ago

This allows to use the type provider while the Excel file is open in Excel 365.

goswinr commented 3 years ago

I could not get this repro to build, So I made my own without Paket or Fake to test this change https://github.com/goswinr/ExcelProvider2

quintusm commented 3 years ago

HI @goswinr

I am aware of the building issues, and working on it. It is unfortunately quite a big change to bring it up to date.

Thanks for the pull request. I will have a look at it and merge it. Looking at it quickly I cannot see that it is a problem at all.

quintusm commented 3 years ago

@goswinr

I have merged your pull request. Once again thanks for contributing!

goswinr commented 3 years ago

Thanks, so you currently cannot publish a new nuget ?

goswinr commented 3 years ago

I am not sure if there is now a small risk that concurrent writing and reading the file might yield a corrupt stream. But probaly the Exception handler would catch that, no ?

quintusm commented 3 years ago

HI

I have tried to do some reading on this topic. It seems that for reading .Net tries to keep track of changes. If it detects changes it will discard the buffer and read the stream from the start again., as per the documentation. If you try to write, which we are not doing, it would throw an exception.

So I think the chances of something getting corrupted is small enough that the risk is worth taking...

quintusm commented 3 years ago

Thanks, so you currently cannot publish a new nuget ?

I will try to do a new nuget soon. Sorry for the delay.

I don't need to do all the changes I am busy with before being able to push a nuget,