Saving as Read Only Recommend

Hi,

We have a requirement to save files down with read only recommend enabled. I could not find any mention of this in the docs, could you help me?

Make a document read only - Microsoft Support

Thanks.

Hi,


Yes, the feature is supported. Please try using WorkbookSettings.RecommendReadOnly Boolean attribute to true. Please see the following sample code for your requirements for your reference:
e.g
Sample code:

//Open an Excel file.
Workbook workbook = new Workbook(@“e:\test\Book1.xls”);
//Set recommended read-only option on.
workbook.Settings.RecommendReadOnly = true;

//Set Passord to modify option.
// workbook.Settings.IsWriteProtected = true;
//Set the password for modification.
// workbook.Settings.WriteProtectedPassword = “1234”;
//Save the Excel file.
workbook.Save(@“e:\test2\out1.xls”);


Let us know if I can be of any further help.

Thank you.

Thanks for your quick response. I was looking at docs for save properties, which I expected because of it’s structured in VBA.

Hi,


Hopefully the suggested code segment would suit your needs well. Please try using some WorkbookSettings class attributes (e.g RecommendReadOnly, IsWriteProtected, Password) if you need to make the workbook read-only Recommended, write protected workbook or set file/ workbook’s encryption password etc. The following document may help you on encrypting Excel files for your further reference:
http://www.aspose.com/docs/display/cellsnet/Encrypting+Excel+Files


Thank you.