ExcelDocument data type

Official Content
This documentation is valid for:

Unify interaction with the generation of Microsoft Excel documents for the different languages generated. It allows you to generate and handle Microsoft Excel worksheets. In addition, the ExcelCells data type is implemented internally and is used to handle the group of cells contained in the worksheet.

An important advantage that this implementation has over the previous ones is that spreadsheets are handled with an object-oriented model and it is no longer necessary to control Handles.


AutoFit property MacroReturnNumber Property
Delimiter Property MacroReturnText Property
ErrCode Property Extended Data Types Read-Only property
ErrDescription Property Template Property
ErrDisplay Property UseAutomation Property
MacroReturnDate Property  


Cells Method RenameSheet Method
Clear method RunMacro Method
Close Method Save Method for excel document and word document extended data types
Hide Method SelectSheet Method
Open Method Show Method
Print Method Unbind Method


Languages .NET, Java


Event "Excel"

   If &ExcelDocument.ErrCode <> 0 
       &ExcelDocument.Cells(1,1).Text = 'Customers list'  
       &ExcelDocument.Cells(1,1).Bold = 1 
       &ExcelDocument.Cells(1,1).Color = RGB(0, 0, 255) 
       &ExcelDocument.Cells(1,1).Size = 10 
       &ExcelDocument.Cells(3,1).Text = 'Customer Id' 
       &ExcelDocument.Cells(3,1).Italic = 1 
       &ExcelDocument.Cells(3,1).Bold = 1 
       &row = 4 
       &col = 1 
       For Each Line in Grid 
               &ExcelDocument.Cells(&row,&col).Number = CustomerId 
               &ExcelDocument.Cells(&row,&col).Color = RGB(0, 0, 255) 
               &row += 1    


There are two possible implementations:

  • EPPLUS: Genexus uses this implementation when xlsx file extension is configured (which is recommendable). Check here for more information.
  • ExcelLite DLL: Genexus uses this implementation when the necessary file - GemBox.Spreadsheet.dll - is available after installing GemBox's spreadsheet software

Note: The only way to generate the proprietary xls files is using ExcelLite.


Check here for more information.

Managing excel documents common issues

See also

ExcelCells data type