Skip to main content

Open spreadsheet as read-only - Community / GemBox.Spreadsheet Feature Request - GemBox Support Center

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

Comments (3)

Stuart Reabow
Hi,

Please could I have an update on this feature request


Thanks
Mario - GemBox
Hi,

Unfortunately this feature is not in our current roadmap, so I'm afraid it won't be available in next 6 months. For later I cannot say at the moment.

Regards,

Mario
GemBox d.o.o.
Mario - GemBox
Hi,

Apologize, I misunderstood what this feature request was for.
I judged only based on feature's title and presumed that the feature was related to 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 problem remains please submit a support ticket and we'll investigate your issue.

Regards,

Mario
GemBox d.o.o.