We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to create excel file in read-only mode

Hi Syncfusion,

What settings should be overridden for the excel file to save in read-only mode?

Thanks!


1 Reply

SR Sridhar Syncfusion Team March 1, 2011 07:34 AM UTC

Hi Ram,

Thank you for using syncfusion products.

We can create an excel file in read - only mode. i have given below the code.

Iworkbook workbook=application.workbooks.OpenReadOnly(filename);

and it does not override any setting of an worksheet.

To save an readonly i have attached here with the sample, where we have to change the FileAttributes and write it to the file, then only we can save it.

Please try the sample and let us know if this helps you.

Pleae let us know if you require any further clarifications.
Thanks,
Sridhar.S







OpenReadonlyfile_6a4d2ee1.zip

Loader.
Live Chat Icon For mobile
Up arrow icon