XlTable is designed to maximize the DDE transfer speed of Microsoft Excel. XlTable consists of a sequence of data blocks that represent a rectangular selection of cells (a table). Each data block has three parts: WORD tdt /* the table data type */ WORD cb /* the size (count of bytes) of the data */ BYTE data[cb] /* the data */ The first data block is always of type tdtTable, which specifies the number of rows and the number of columns in the table. The data blocks that follow tdtTable represent all the cells in the table. Microsoft Excel renders the reference of the cells in the table (for example, R1C1:R2C4) as the item part of the DDE message. The cells are always rendered row-wise. In other words, all the cells in the first row of the table appear first, then all the cells in the second row, and so on. To minimize overhead, adjacent cells of the same type (tdt) are represented together in one data block, even if the cells are in different rows. In other words, one tdtFloat can contain several numbers, one tdtString can contain several strings, one tdtBool can contain several Boolean values, and so on. For examples, see the following sections, "XlTable Example 1" and "XlTable Example 2." The data block types are described in the following table. tdtTable cb rows cols 16 4 y x // This chunk must precede following chunk(s) tdtFloat cb numbers 1 n*8 n DOUBLEs // NaN, INF must be transferred as error values! tdtString cb strings 2 ByteCount (counted) Pascal strings without gaps (ANSI-CP) // Padding at end? tdtBool cb booleans 3 n*2 n WORDs: 1=TRUE, 0=FALSE tdtError cb error codes 4 n*2 n WORDs: 0=#NULL!, 7=#DIV/0!, 15=#VALUE!, 23=#REF!, 29=#NAME?, 36=#NUM!, 42=#N/A deutsch: #WERT! #BEZUG! #ZAHL! #NV tdtBlank cb number of blank (emptied out) cells 5 2 Number of blank cells tdtInt cb unsigned integers 6 n*2 n WORDs // Excel never generates this chunk tdtSkip cb number of skipped (not touched) cells 7 2 Number of cells to skip XlTable Example 1 The following selection of three cells … A1 East A2 West A3 North … produces the XlTable rendering shown in the following table. Data (hexadecimal) Description 10 00 04 00 01 00 03 00 tdtTable, cb=4, rows=1, columns=3 02 00 10 00 tdtString, cb=16 04 45 61 73 74 cch=4, East (tdtString continued) 04 57 65 73 74 cch=4, West (tdtString continued) 05 4e 6f 72 74 68 cch=5, North (tdtString continued) Notice that the table contains three cells, but the XlTable rendering contains only one tdtString data block. XlTable Example 2 The XlTable format uses the tdtBlank data block to represent blank cells in a table. A sequence of several blank cells may be represented by a single tdtBlank data block. For example, the following table … A1: 2 A2: 3 B1: 4 B2: 5 D1: 6 D2: 7 … produces the following XlTable rendering. Data (hexadecimal) Description 10 00 04 00 02 00 04 00 tdtTable, cb=4, rows=4, columns=2 06 00 08 00 02 00 03 00 04 00 05 00 tdtInt, cb=8, int[0]=2, int[1]=3, int[2]=4, int[3]=5 05 00 02 00 02 00 tdtBlank, cb=2, data=2 (two cells are blank) 06 00 04 00 06 00 08 00 tdtInt, cb=4, int[0]=6, int[1]=8