Déprotéger une feuille de calcul dans Python

Aspose.Cells - Déprotéger une feuille de calcul

Pour protéger la feuille de calcul à l’aide deAspose.Cells Java for Python , téléphoner àunprotect_worksheet méthode deprotection module.

Code Python

 filesFormatType = self.FileFormatType

# Instantiating a Workbook object

workbook = self.Workbook(self.dataDir + "Book1.xls")

worksheets = workbook.getWorksheets()

worksheet = worksheets.get(0)

protection = worksheet.getProtection()

# The following 3 methods are only for Excel 2000 and earlier formats

protection.setAllowEditingContent(False)

protection.setAllowEditingObject(False)

protection.setAllowEditingScenario(False)

# Unprotecting the worksheet

worksheet.unprotect()

\# Save the excel file.

workbook.save(self.dataDir + "output.xls", filesFormatType.EXCEL_97_TO_2003)

# Print Message

print "Worksheet unprotected successfully."

Télécharger le code d’exécution

TéléchargerDéprotéger une feuille de calcul (Aspose.Cells) à partir de l’un des sites de codage social mentionnés ci-dessous :