Node.js ve C++ kullanarak Sayfa Koruma ve Korumayı Kaldırma
Contents
[
Hide
]
Excel çalışma sayfanızdaki verilerin yanlışlıkla veya kasıtlı olarak değişmesini, taşınmasını veya silinmesini engellemek için hücreleri kilitleyebilir ve sayfayı bir şifre ile koruyabilirsiniz.
MS Excel’de Çalışma Sayfasını Koruma ve Kaldırma
- Tıklayın İncele > Sayfayı Koru.
- Şifre kutusuna bir şifre girin.
- izin ver seçeneklerini seçin.
- 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");