Specify Author while Write Protecting Workbook

Possible Usage Scenarios

You can specify author name while write protecting your workbook using Aspose.Cells API. Please use Workbook.Settings.WriteProtection.Author property for this purpose.

Specify Author while Write Protecting Workbook

The following sample code explains the usage of the Workbook.Settings.WriteProtection.Author property. The code creates an empty workbook, write protects it with a password, specifies the author’s name and saves it as an output Excel file. The following screenshot illustrates the effect of the sample code on the output Excel file for your reference.

todo:image_alt_text

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Create empty workbook.
Workbook wb = new Workbook();
// Write protect workbook with password.
wb.getSettings().getWriteProtection().setPassword("1234");
// Specify author while write protecting workbook.
wb.getSettings().getWriteProtection().setAuthor("SimonAspose");
// Save the workbook in XLSX format.
wb.save(outDir + "outputSpecifyAuthorWhileWriteProtectingWorkbook.xlsx");