HTML JPG PDF XML XLS
Aspose.Cells  for C++
XLS

Unlock XLS Files via C++

Remove protection from Excel spreadsheets including XLS file using C++ Library.

How to Remove Protection of XLS File Using C++

In order to unlock XLS file, we’ll use

Aspose.Cells for C++

API which is a feature-rich, powerful and easy to use document protection API for C++ platform. You can download its latest version directly, just open

NuGet

package manager, search for Aspose.Cells.Cpp and install. You may also use the following command from the Package Manager Console.

Aspose.Cells


PM> Install-Package Aspose.Cells.Cpp

Unlock XLS via C++

You need

aspose.cells.dll

referenced in your project to execute the following workflow.

  1. Load XLS locked file using CreateIWorkbook.
  2. Call Unprotect() function to unlock.
  3. Set password to NULL using SetPassword.
  4. Save XLS file at a specified location.

System Requirements

Aspose.Cells for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
  • Add reference to the Aspose.Cells for C++ DLL in your project.
 

Command


// Source directory path.
StringPtr srcDir = new String("SourceDirectory\\");

// Output directory path.
StringPtr outDir = new String("OutputDirectory\\");

// Load XLS file
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook(srcDir->StringAppend(new String("sampleExcelFileProtected.xls")));

// Unprotect workbook
workbook->Unprotect(new String("12345"));

// Set password to null
workbook->GetISettings()->SetPassword(NULL);

// Save the XLS file
workbook->Save(outDir->StringAppend(new String("sampleExcelFileUnprotected_out.xls")));
 
  • About Aspose.Cells for C++ API

    Aspose.Cells API can be used to create, edit, convert and render Microsoft Excel formats to different formats. Moreover, it can be used for comprehensive charting, scalable reporting and reliable calculations within software applications. Aspose.Cells is a standalone API and it does not require any software like Microsoft or OpenOffice.

    Free App to Unlock XLS

    Other Supported Unlocking Formats

    Using C++, one can easily remove protection / unlocking of different formats including.

    ODS (OpenDocument Spreadsheet File)
    XLSB (Binary Excel Workbook File)
    XLSM (Spreadsheet File)
    XLSX (OOXML Excel File)