It is only possible, if the file is opened for reading by a third-party, but not for writing.
If the third-party opened the file for writing, your attempt to open the same file even just for reading will result in System.IO.IOException
. In fact, it's all about FileStream
and not specific to EpPlus and ExcelPackage. Example in terms of .NET:
var fileStream1 = new FileStream(@"File.ext", FileMode.Open, FileAccess.Read);
var fileStream2 = new FileStream(@"File.ext", FileMode.Open, FileAccess.Read);
will work just fine. But the second line of the following fragment:
var fileStream1 = new FileStream(@"File.ext", FileMode.Open, FileAccess.Write);
var fileStream2 = new FileStream(@"File.ext", FileMode.Open, FileAccess.Read);
will result in a System.IO.IOException
.