Node.js ve C++ kullanarak Sayfa Koruma ve Korumayı Kaldırma

MS Excel’de Çalışma Sayfasını Koruma ve Kaldırma

çalışma sayfasını koruma ve kaldırma

  1. Tıklayın İncele > Sayfayı Koru.
  2. Şifre kutusuna bir şifre girin.
  3. izin ver seçeneklerini seçin.
  4. Tamam‘ı seçin, şifreyi teyit etmek için tekrar girin, ardından tekrar Tamam‘ı seçin.

Aspose.Cells for Node.js via C++ kullanarak Sayfa Koruma

Excel dosyalarının çalışma sayfasını korumak için sadece aşağıdaki basit kod satırlarına ihtiyaç vardır.

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

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Create a new file.
const workbook = new AsposeCells.Workbook();
// Gets the first worksheet.
const sheet = workbook.getWorksheets().get(0);
// Protect contents of the worksheet.
sheet.protect(AsposeCells.ProtectionType.Contents);
// Protect worksheet with password.
sheet.getProtection().setPassword("test");
// Save as Excel file.
workbook.save("Book1.xlsx");

Aspose.Cells for Node.js via C++ kullanarak Sayfa Korumasını Kaldırma

Sayfa korumasını kaldırmak Aspose.Cells API ile kolaydır. Eğer sayfa parola korumalıysa, doğru parola gereklidir.

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(filePath);
// Gets the first worksheet.
const sheet = workbook.getWorksheets().get(0);
// Protect contents of the worksheet.
sheet.unprotect("password");
// Save Excel file.
workbook.save("Book1.xlsx");

Gelişmiş Konular