Skip to main content linkedinfacebooktwittermenuarrow-up
4

Open spreadsheet as read-only Completed

Hi, I'd like to request a feature which would allow opening a spreadsheet as read-only to allow reading a spreadsheet even if a user has it open for editing.

ThanksStuart

Official response

Mario at GemBox

Hi,

Apologize, I misunderstood what this feature request was for.
I judged only based on the feature's title and presumed that the feature was related to the workbook's protection (saving a file as read-only).

The feature you are looking for already exists in GemBox.Spreadsheet.
When using the following Load method GemBox.Spreadsheet will open a file with FileAccess.Read mode:


ExcelFile ef = ExcelFile.Load("Sample.xlsx");

This loading works even if the file is opened by another application.
In case you're using another Load method that accepts a stream then you'll need to make sure that the provided stream has the correct access option for your requirements, for example:

using (var stream = File.Open("Sample.xlsx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
ExcelFile ef = ExcelFile.Load(stream, LoadOptions.XlsxDefault);
// ...
}


I hope this helps.
If the problem remains please submit a support ticket and we'll investigate your issue.

Regards,
Mario

Comments (2)

Stuart Reabow
Hi, Please could I have an update on this feature request Thanks
Mario at GemBox
Hi, Unfortunately, this feature is not in our current roadmap, so I'm afraid it won't be available in the next 6 months. For later I cannot say at the moment. Regards, Mario