Protéger et déprotéger la structure du classeur

Protéger et déprotéger la structure du classeur dans MS Excel

Protéger et déprotéger la structure du classeur

  1. Cliquez sur Relecture > Protéger le classeur.
  2. Entrez un mot de passe dans la boîte de mot de passe.
  3. Sélectionnez OK, saisissez à nouveau le mot de passe pour le confirmer, puis sélectionnez à nouveau OK.

Protéger la structure du classeur avec Aspose.Cells pour Python via .NET

Il suffit d’utiliser les lignes de code suivantes pour implémenter la protection de la structure du classeur Excel.

from aspose.cells import ProtectionType, Workbook
# Create a new file.
workbook = Workbook()
# Protect workbook structure.
workbook.protect(ProtectionType.STRUCTURE, "password")
# Save Excel file.
workbook.save("Book1.xlsx")

Déprotéger la structure du classeur avec Aspose.Cells pour Python via .NET

La déprotection de la structure du classeur est facile avec l’API Aspose.Cells pour Python via .NET.

from aspose.cells import Workbook
# 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")