ワークブックの書き込み保護中に作成者を指定する
考えられる使用シナリオ
Aspose.Cells API を使用してワークブックを書き込み保護しながら作成者名を指定できます。使用してください。Workbook.Settings.WriteProtection.Author この目的のためのプロパティ。
ワークブックの書き込み保護中に作成者を指定する
次のサンプル コードは、Workbook.Settings.WriteProtection.Author 財産。このコードは、空のワークブックを作成し、パスワードで書き込み保護し、作成者名を指定して、名前を付けて保存します。出力エクセルファイル .次のスクリーンショットは、参考用に出力 Excel ファイルに対するサンプル コードの効果を示しています。
サンプルコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Create empty workbook.
Workbook wb = new Workbook();
// Write protect workbook with password.
wb.Settings.WriteProtection.Password = "1234";
// Specify author while write protecting workbook.
wb.Settings.WriteProtection.Author = "SimonAspose";
// Save the workbook in XLSX format.
wb.Save(outputDir + "outputSpecifyAuthorWhileWriteProtectingWorkbook.xlsx");