حماية هيكل المصنف وإلغاء حمايته
Contents
[
Hide
]
لمنع المستخدمين الآخرين من عرض أوراق العمل المخفية أو إضافة أوراق العمل أو نقلها أو حذفها أو إخفائها وإعادة تسمية أوراق العمل ، يمكنك حماية بنية مصنف Excel بكلمة مرور.
Aspose.Cells for Python يدعم حماية وإلغاء حماية بنية مصنف ملفات Excel.
حماية وإلغاء حماية هيكل المصنف في MS Excel
! [حماية بنية المصنف وإلغاء حمايتها] (protect-and-unotect-workbook-structure.png)
- انقرمراجعة> حماية المصنف.
- أدخل كلمة المرور فيمربع كلمة المرور.
- يختارنعم ، وأعد إدخال كلمة المرور لتأكيدها ، ثم حددنعم تكرارا.
حماية هيكل المصنف باستخدام 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") |
ملاحظة: مطلوب كلمة مرور صحيحة.