حماية وإلغاء حماية ورقة العمل
Contents
[
Hide
]
لمنع المستخدمين الآخرين من تغيير البيانات في ورقة عمل أو نقلها أو حذفها عن طريق الخطأ أو عن عمد ، يمكنك قفل الخلايا في ورقة عمل Excel ثم حماية الورقة بكلمة مرور.
حماية وإلغاء حماية ورقة العمل في MS Excel
! [حماية وإلغاء حماية ورقة العمل] (protect-and-unotect-workheet.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() | |
#Gets the first worksheet. | |
sheet = workbook.getWorksheets().get(0) | |
#Protect contents of the worksheet. | |
sheet.protect(ProtectionType.CONTENTS) | |
#Protect worksheet with password. | |
sheet.getProtection().setPassword('test') | |
#Save as 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
#Create a new file. | |
workbook = Workbook("Book1.xlsx") | |
#Gets the first worksheet. | |
sheet = workbook.getWorksheets().get(0) | |
#Protect contents of the worksheet. | |
sheet.unprotect("password") | |
#Save Excel file. | |
workbook.save("Book1.xlsx") |