حماية كلمة المرور أو إلغاء حمايتها لكتاب العمل المشترك

سيناريوهات الاستخدام المحتملة

يمكنك حماية أو فك حماية الجدول المشترك بواسطة Microsoft Excel كما هو موضح في اللقطة المصغرة التالية. تدعم Aspose.Cells أيضًا هذه الميزة بالطريقتين Workbook.protectSharedWorkbook() و Workbook.unprotectSharedWorkbook().

todo:image_alt_text

حماية كلمة المرور أو إلغاء حمايتها لكتاب العمل المشترك

المثال التالي ينشئ ورق عمل ويقوم بحمايته مع تمكين المشاركة وحفظه كملف إكسل المخرج. تُظهر اللقطة الشاشية عند محاولة إلغاء الحماية، يطلب منك برنامج Microsoft Excel إدخال كلمة المرور لإلغاء الحماية.

todo:image_alt_text

الكود المثالي

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
//Create empty Excel file
Workbook wb = new Workbook();
//Protect the Shared Workbook with Password
wb.protectSharedWorkbook("1234");
//Uncomment this line to Unprotect the Shared Workbook
//wb.unprotectSharedWorkbook("1234");
//Save the output Excel file
wb.save("outputProtectSharedWorkbook.xlsx");