protect yöntemi
İçindekiler
[
Saklamak
]protect(self, type)
Çalışma sayfasını korur.
def protect(self, type):
...
Parametre | Tip | Tanım |
---|---|---|
type | ProtectionType | Koruma türü. |
Notlar
Bu yöntem, çalışma sayfalarını şifresiz olarak korur. protect çalışma sayfası Excel dosyasının tüm versiyonlarında kullanılabilir.
protect(self, type, password, old_password)
Çalışma sayfasını korur.
def protect(self, type, password, old_password):
...
Parametre | Tip | Tanım |
---|---|---|
type | ProtectionType | Koruma türü. |
password | str | Şifre. |
old_password | str | Eğer çalışma sayfası zaten bir parola ile korunuyorsa lütfen eski parolayı girin. Aksi takdirde bu parametreye null değer veya boş bir dize atayabilirsiniz. |
Notlar
Bu yöntem protect çalışma sayfasını Excel dosyasının tüm versiyonlarında çalıştırabilir.
Örnek
from aspose.cells import ProtectionType, Workbook
# Instantiating a Workbook object
excel = Workbook("template.xlsx")
# Accessing the first worksheet in the Excel file
worksheet = excel.worksheets[0]
# Protecting the worksheet with a password
worksheet.protect(ProtectionType.ALL, "aspose", None)
# Saving the modified Excel file in default (that is Excel 20003) format
excel.save("output.xls")
Ayrıca bakınız
- modül
aspose.cells
- sınıf
Worksheet