Protege o desbloquea por contraseña el libro compartido con Node.js via C++
Contents
[
Hide
]
Escenarios de uso posibles
Puedes proteger o desbloquear el libro compartido con Microsoft Excel como se muestra en la siguiente captura. Aspose.Cells for Node.js via C++ también soporta esta función con los métodos Workbook.protectSharedWorkbook(string) y Workbook.unprotectSharedWorkbook(string).
Proteger o Quitar Protección al Libro de Trabajo Compartido
El siguiente código de ejemplo crea un libro de trabajo y lo protege mientras habilita el uso compartido y lo guarda como archivo de Excel de salida. La captura de pantalla muestra que cuando intentas quitar la protección, Microsoft Excel te pedirá que ingreses la contraseña para quitarla.
Código de muestra
const AsposeCells = require("aspose.cells.node");
const path = require("path");
// Create empty Excel file
const workbook = new AsposeCells.Workbook();
// Protect the Shared Workbook with Password
workbook.protectSharedWorkbook("1234");
// Uncomment this line to Unprotect the Shared Workbook
// workbook.unprotectSharedWorkbook("1234");
// Save the output Excel file
workbook.save("outputProtectSharedWorkbook.xlsx");