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 and ClosedXML libraries
- Microsoft .NET Framework 4.5 or higher required
- available for Delphi 7 - 10.4
- royalty free distribution in applications
Download and order
Order Office XML library $80 USD (license for one developer)
Order Office XML multi-license $240 USD (license for all developers in the company)
Order Office XML year upgrades $40 USD (registered users only)
Order Office XML year upgrades multi-license $120 USD (registered multi-license users only)
FAQ
How can I solve "Project Demo.exe raised exception class $C0000090 with message 'floating point invalid operation at 0x07a2376a'." error message?
Switch off floating point exceptions using this code:
Use XLWorkbookClass class:
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:
Switch off floating point exceptions using this code:
Set8087CW(Get8087CW or $3F);How can I open existing .xlsx file?
Use XLWorkbookClass class:
var WorkbookClass: XLWorkbookClass; Workbook: XLWorkbook; ... WorkbookClass := CoXLWorkbookClass.Create; Workbook := WorkbookInstance.Create_5('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_3('password'); Protection.SelectLockedCells := False; Protection.SelectUnlockedCells := False;How can I solve "Class not registered." error message?
- 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.4.0.0" publicKeyToken="c2371442b2cedf55" processorArchitecture="msil"/> </dependentAssembly> </dependency> </assembly>
// {$R *.res}