Is there a way to read binary data from a read-only file? I have an Excel worksheet, which might be opened in Excel but I want to open it for read purposes only.
I tried to do it this way:
using (FileStream fileStream = File.Open(filepath, FileMode.Open, FileAccess.Read, FileShare.Read))
And I am getting
The process cannot access the file 'something.xlsx' because it is being used by another process.
Is there any way to achieve that?