Office XML

Delphi library for processing Excel .xlsx documents.
  • create or modify Excel Workbook .xlsx files
  • Microsoft Office installation is not required
  • uses Microsoft Open XML SDK 2.5 and ClosedXML libraries
  • requires Microsoft .NET 4 Framework or higher
  • available for Delphi 7 - 10.1
  • royalty free distribution in applications

Download and order

Order Office XML library $60,- USD (license for one developer)
Order Office XML multilicense $180,- USD (license for all developers in company)
Order Office XML year upgrades $30,- USD (registered users only)
Order Office XML year upgrades multilicense $90,- USD (registered multilicense users only)

FAQ

How can I open existing .xlsx file?
Use XLWorkbookInstance class:
var
  WorkbookInstance: XLWorkbookInstance;
  Workbook: XLWorkbook;
...
  WorkbookInstance := CoXLWorkbookInstance.Create;
  Workbook := WorkbookInstance.Create_3('example.xlsx');
...
							
How can I set workbook properties?
Workbook.Properties.Title := 'Title';
Workbook.Properties.Subject := 'Subject';
							
How can I set worksheet protection?
var
  Worksheet: IXLWorksheet;
  Protection: IXLSheetProtection;
...
  Protection := Worksheet.Protect_2('password');
  Protection.SelectLockedCells := False;
  Protection.SelectUnlockedCells := False;
							
How can I solve "Class not registered." error message?
  • Use .NET Framework Detect utility to check whether Microsoft .NET Framework 4.0 or higher is installed.
  • Create manifest file yourapplicationname.exe.manifest (change yourapplicationname accordingly to the name of your application):
  • <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="yourapplicationname" type="win32"/>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
            publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
        </dependentAssembly>
      </dependency>
    
      <dependency>
        <dependentAssembly>
          <assemblyIdentity name="Winsoft.OfficeXML" version="2.1.0.0" publicKeyToken="c2371442b2cedf55" processorArchitecture="x86"/>
        </dependentAssembly>
      </dependency>
    </assembly>
    							
  • Embed yourapplicationname.exe.manifest file to your application: Select Delphi menu Project/Options.../Application. Change Manifest File combobox to Custom and select yourapplicationname.exe.manifest file in Custom manifest edit box.
  • Instead of embedding yourapplicationname.exe.manifest file to your application, you can comment "{$R *.res}" line in yourapplicationname.dpr file and use external yourapplicationname.exe.manifest file:
  • // {$R *.res}
    							

Related links