Hoja de trabajo de protección y desprotección
Contents
[
Hide
]
Para evitar que otros usuarios cambien, muevan o eliminen datos en una hoja de cálculo de forma accidental o deliberada, puede bloquear las celdas de su hoja de cálculo de Excel y luego proteger la hoja con una contraseña.
Proteger y desproteger la hoja de trabajo en MS Excel
![hoja de trabajo para proteger y desproteger] (hoja de trabajo para proteger y desproteger.png)
- Hacer clicRevisar > Proteger hoja de trabajo.
- Introduzca una contraseña enel cuadro de contraseña.
- Seleccionepermitir opciones
- SeleccioneDE ACUERDO , vuelva a ingresar la contraseña para confirmarla y luego seleccioneDE ACUERDO de nuevo.
Proteger hoja de trabajo usando Aspose.Cell for Python
Solo necesita las siguientes líneas simples de código para implementar la protección de la estructura del libro de trabajo de los archivos de Excel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a new file. | |
workbook = Workbook() | |
#Gets the first worksheet. | |
sheet = workbook.getWorksheets().get(0) | |
#Protect contents of the worksheet. | |
sheet.protect(ProtectionType.CONTENTS) | |
#Protect worksheet with password. | |
sheet.getProtection().setPassword('test') | |
#Save as Excel file. | |
workbook.save('Book1.xlsx') |
Desproteger hoja de trabajo usando Aspose.Cell for Python
Desproteger la hoja de trabajo es fácil con Aspose.Cells API. Si la hoja de trabajo está protegida con contraseña, se requiere una contraseña correcta.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a new file. | |
workbook = Workbook("Book1.xlsx") | |
#Gets the first worksheet. | |
sheet = workbook.getWorksheets().get(0) | |
#Protect contents of the worksheet. | |
sheet.unprotect("password") | |
#Save Excel file. | |
workbook.save("Book1.xlsx") |