TXlsWorkbookEh class
TXlsWorkbookEh class
Workbook. TXlsMemFileEh
contains one copy of a workbook of type TXlsWorkbookEh
. The workbook contains a set of tables (TXlsWorksheetEh
) and TXlsFileStylesEh
styles. Styles describe the format of the data cells in the Worksheet
. Each cell must reference one of the styles from the Styles
list. When filling in data in the program code, you do not need to use the TXlsWorkbookEh.Styles
property. The inner code of the TXlsMemFileEh
class automatically creates styles and style references when the format changes in table cells. You can use TXlsMemFileEh.Workbook
property to access TXlsWorkbookEh
properties and methods.
The following TXlsWorkbookEh
properties and methods are used to work with work pages (Worksheet
):
function AddWorksheet(WorksheetName: string): TXlsWorksheetEh;
function FindWorksheet(WorksheetName: string): TXlsWorksheetEh;
procedure MoveWorksheet(FromIndex, ToIndex: Integer);
procedure RemoveWorksheet(WorksheetEh: TXlsWorksheetEh);
property Worksheets[WorksheetId: Variant]: TXlsWorksheetEh;
property WorksheetCount: Integer;
Here is an example of using the Workbook property.
xlsFile := TXlsMemFileEh.Create;
xlsFile.Workbook.Worksheets[0].Name := 'DBGrid';
xlsFile.Workbook.AddWorksheet('VertGrid');