We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving as Read Only Recommend


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?




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:
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.

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.


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:

Thank you.