ブック構造の保護と保護解除
Contents
[
Hide
]
他のユーザーが非表示のワークシートを表示したり、ワークシートを追加、移動、削除、非表示にしたり、ワークシートの名前を変更したりできないようにするために、Excel ブックの構造をパスワードで保護できます。
Aspose.Cells for Python は、Excel ファイルのブック構造の保護と保護解除をサポートします。
MS Excel でワークブック構造を保護および保護解除する
- クリックレビュー > ブックの保護.
- にパスワードを入力してくださいパスワードボックス.
- 選択するわかった、パスワードを再入力して確認し、わかったまた。
Aspose.Cell for Python を使用してブック構造を保護する
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
#Create a new file. | |
workbook = Workbook() | |
#Protect workbook structure. | |
workbook.protect(ProtectionType.STRUCTURE, "password") | |
#Save Excel file. | |
workbook.save("Book1.xlsx") |
Aspose.Cell for Python を使用してブック構造の保護を解除する
Aspose.Cells API を使用すると、ブック構造の保護を簡単に解除できます。
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
#Open an Excel file which workbook structure is protected. | |
workbook = Workbook("Book1.xlsx") | |
#Unprotect workbook structure. | |
workbook.unprotect("password") | |
#Save Excel file. | |
workbook.save("Book1.xlsx") |
注: 正しいパスワードが必要です。