Proteger y desbloquear la estructura del libro con Node.js via C++

Proteger y desproteger la estructura del libro en MS Excel

proteger y desproteger la estructura del libro

  1. Haga clic en Revisar > Proteger libro.
  2. Ingrese una contraseña en el cuadro de Contraseña.
  3. Seleccione Aceptar, vuelva a ingresar la contraseña para confirmarla y luego seleccione Aceptar nuevamente.

Proteger estructura del libro usando Aspose.Cells for Node.js via C++

Solo necesitas las siguientes líneas de código simples para implementar la protección de la estructura del libro de trabajo de archivos de Excel.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "Book1.xlsx");
// Create a new file.
const workbook = new AsposeCells.Workbook();
// Protect workbook structure.
workbook.protect(AsposeCells.ProtectionType.Structure, "password");
// Save Excel file.
workbook.save(filePath);

Desproteger estructura del libro usando Aspose.Cells for Node.js via C++

Desproteger la estructura del libro es fácil con la API de Aspose.Cells.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "Book1.xlsx");

// Open an Excel file which workbook structure is protected.
const workbook = new AsposeCells.Workbook(filePath);
// Unprotect workbook structure.
workbook.unprotect("password");
// Save Excel file.
workbook.save(filePath);