إلغاء حماية ورقة العمل
إلغاء حماية ورقة العمل
استخدام Microsoft Excel
لإزالة الحماية من ورقة العمل:
من قائمة الـأدوات, حدد الحماية ثم اختر إلغاء حماية الورقة. سيتم إزالة الحماية ما لم تكن ورقة العمل محمية بكلمة مرور. في هذه الحالة، سيظهر مربع حوار لإدخال كلمة المرور. أدخل كلمة المرور وسيتم إزالة حماية ورقة العمل بعد ذلك.
إزالة الحماية من ورقة العمل المحمية بشكل بسيط باستخدام Aspose.Cells
يمكن إلغاء حماية ورقة العمل عن طريق استدعاء الفئة Worksheet الوسيلة Unprotect. ورقة العمل المحمية بسيطة هي تلك التي لا يتم حمايتها بكلمة المرور. يمكن إلغاء حماية مثل تلك الأوراق العمل عن طريق استدعاء الوسيلة Unprotect دون تمرير معلمة.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xls"); | |
// Accessing the first worksheet in the Excel file | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Unprotecting the worksheet without a password | |
worksheet.Unprotect(); | |
// Saving the Workbook | |
workbook.Save(dataDir + "output.xls", SaveFormat.Excel97To2003); |
إلغاء حماية ورقة العمل المحمية بكلمة المرور باستخدام Aspose.Cells
ورقة العمل المحمية بكلمة المرور هي تلك التي تم حمايتها بكلمة مرور. يمكن إلغاء حماية مثل تلك الأوراق العمل عن طريق استدعاء النسخة المتجاوبة للوسيلة Unprotect التي تأخذ كلمة المرور كمعلمة.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xls"); | |
// Accessing the first worksheet in the Excel file | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Unprotecting the worksheet with a password | |
worksheet.Unprotect(""); | |
// Save Workbook | |
workbook.Save(dataDir + "output.out.xls"); |