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
FAQ
How can I open existing .xlsx file?
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:
Use XLWorkbookClass class:
How can I set workbook properties?var
WorkbookClass
:
XLWorkbookClass
;
Workbook
:
XLWorkbook
;
..
.
WorkbookClass
:=
CoXLWorkbookClass
.
Create
;
Workbook
:=
WorkbookInstance
.
Create_5
(
'example.xlsx'
)
;
..
.
How can I set worksheet protection?Workbook
.
Properties
.
Title
:=
'Title'
;
Workbook
.
Properties
.
Subject
:=
'Subject'
;
How can I solve "Class not registered." error message?var
Worksheet
:
IXLWorksheet
;
Protection
:
IXLSheetProtection
;
..
.
Protection
:=
Worksheet
.
Protect_3
(
'password'
)
;
Protection
.
SelectLockedCells
:=
False
;
Protection
.
SelectUnlockedCells
:=
False
;
- 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}
Buy at Tokopedia!
Buy Now!Tags: Winsoft Office XML, delphi, c++ builder, Document & Office, winsoft, xml