C++ kullanarak Çalışma Kitabı Yapısını Koru ve Korumayı Kaldır

MS Excel’de Çalışma Kitabı Yapısını Koru ve Kaldır

çalışma kitabı yapısını koruma ve kaldırma

  1. Tıklayın İncele > Çalışma Kitabını Koru.
  2. Şifre kutusuna bir şifre girin.
  3. Tamam‘ı seçin, şifreyi teyit etmek için tekrar girin, ardından tekrar Tamam‘ı seçin.

Aspose.Cells for C++ kullanarak çalışma kitabı yapısını koru

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

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Create a new workbook
    Workbook workbook;

    // Protect workbook structure with a password
    workbook.Protect(ProtectionType::Structure, u"password");

    // Save the workbook to a file
    workbook.Save(u"Book1.xlsx");

    std::cout << "Workbook created and protected successfully!" << std::endl;

    Aspose::Cells::Cleanup();
}

Aspose.Cells for C++ kullanarak çalışma kitabı yapısının korumasını kaldır

Aspose.Cells API ile çalışma kitabı yapısını korumak kolaydır.

#include <iostream>
#include "Aspose.Cells.h"

using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Open an Excel file which workbook structure is protected.
    U16String inputFilePath = u"Book1.xlsx";
    Workbook workbook(inputFilePath);

    // Unprotect workbook structure.
    workbook.Unprotect(u"password");

    // Save Excel file.
    workbook.Save(inputFilePath);

    std::cout << "Workbook structure unprotected and saved successfully!" << std::endl;

    Aspose::Cells::Cleanup();
}