تشفير وفك تشفير ملفات Excel

استخدام Microsoft Excel

لضبط إعدادات تشفير الملف في Microsoft Excel (هنا Microsoft Excel 2003):

  1. من قائمة الأدوات، حدد الخيارات. ستظهر نافذة حوارية. ١. حدد علامة التبويب الأمان.
  2. أدخل كلمة مرور وانقر متقدم ١. اختر نوع التشفير وقم بتأكيد كلمة المرور.

تشفير ملف Excel باستخدام Aspose.Cells

المثال التالي يوضح كيفية تشفير وحماية ملف Excel بكلمة مرور باستخدام واجهة برمجة التطبيقات Aspose.Cells.

# Open an excel file.
workbook = Workbook("Book1.xls")
# Password protect the file.
workbook.getSettings().setPassword("1234")
# Save the excel file.
workbook.save("encryptedBook1.out.xlsx")

فك تشفير ملف Excel باستخدام Aspose.Cells

من السهل جداً فتح ملف Excel المحمي بكلمة مرور وفك تشفيره باستخدام واجهة برمجة التطبيقات Aspose.Cells كما يلي:

#Open encrypted file with password.
loadOptions = LoadOptions()
loadOptions.setPassword("password")
Workbook workbook = Workbook("Book1.xlsx", loadOptions)
#Remove password.
workbook.getSettings().setPassword(null)
#Save the file.
workbook.save("decrypted.xlsx")