HotXLS Delphi Excel Component 2.5.0 D7-10.3 Rio Full Source [2021]
LINK >> https://bytlly.com/2tuzgT
How to Use HotXLS Delphi Excel Component to Read and Write XLS Files
If you are looking for a high-performance and easy-to-use component for reading and writing Excel XLS files in Delphi and C++Builder, you may want to check out HotXLS Delphi Excel Component. HotXLS is a VCL component library that can write new spreadsheet XLS files and read and modify existing XLS files without requiring Microsoft Excel or Office to be installed.
In this article, we will show you how to use HotXLS Delphi Excel Component 2.5.0 D7-10.3 Rio Full Source to create a simple application that can load, edit, and save XLS files. We will also demonstrate some of the features of HotXLS, such as accessing cell values, formulas, attributes, images, hyperlinks, defined names, worksheets, printing, and exporting.
Getting Started with HotXLS
To use HotXLS in your Delphi or C++Builder project, you need to download the component package from https://www.loslab.com/excel-library/hotxls-component and install it according to the instructions in the readme file. The package includes the full source code of HotXLS and several demo projects that illustrate how to use the component.
After installing HotXLS, you can find the component on the losLab tab of the component palette. To use it in your application, simply drop a THotXLS component on your form and set its properties as needed.
Loading and Saving XLS Files
One of the basic features of HotXLS is loading and saving XLS files. You can use the LoadFromFile and SaveToFile methods of the THotXLS component to read and write XLS files from and to disk. For example, the following code snippet loads an XLS file named test.xls from the current directory and saves it as test2.xls:
uses
HotXLS;
var
xls: THotXls;
begin
xls := THotXls.Create(nil);
try
xls.LoadFromFile('test.xls');
// do some modifications here
xls.SaveToFile('test2.xls');
finally
xls.Free;
end;
end;
You can also load and save XLS files from and to streams using the LoadFromStream and SaveToStream methods.
Accessing Cell Values
Another basic feature of HotXLS is accessing cell values in an XLS file. You can use the Cell property of the THotXls component to get or set the value of a cell by its row and column index. The Cell property returns a THotCell object that has various properties for accessing different types of values, such as NumberValue, StringValue, DateValue, BooleanValue, and FormulaValue.
For example, the following code snippet reads the value of cell A1 and writes it to cell B1:
var
cell: THotCell;
begin
cell := xls.Cell[0, 0]; // row 0 = A, column 0 = 1
if cell nil then
xls.Cell[0, 1].Value := cell.Value; // copy value to B1
end;
You can also use the CellByName property of the THotXls component to get or set the value of a cell by its name. For example:
var
cell: THotCell;
begin
cell := xls.CellByName['A1'];
if cell nil then
xls.CellByName['B1'].Value := cell.Value; // copy value to B1
end;
Using Formulas
HotXLS supports reading and writing Excel formulas in XLS files. You can use the FormulaValue property of the THotCell object to get or set the formula of a cell. For example:
var
cell: THotCell;
begin
cell := xls.Cell[0, 0]; // A1 ec8f644aee