126.96.36.199 Retrieval of Last-Calculated Cell Values Without Loading Cell Table
The only way to retrieve formulas, formats and other cell data is to read the cell table normally as defined earlier. However, in certain situations (for example when resolving external references to values) it is beneficial to retrieve only the last calculated value from a cell, without actually loading the cell table. To improve the performance of a random read access to the values in the cell table (section 2.2.1), BIFF provides Index (section 2.4.144) and DBCell (section 2.4.78) records. To find a particular cell value, an application can perform the following:
Read Index records to find one such that the cell row is greater or equal to rwMic and less than rwMac.
Compute the data offset of the required DBCell record according to the description of the Index record.
Read the DBCell record (section 2.4.78) in the obtained position, and compute the data offset of the cell row according to the following:
The file position of the first non-empty Row (section 2.4.221) in a row block is equal to the file position of the DBCell record ─the dbRtrw field of DBCell record.
The file position of the first CELL record (section 188.8.131.52.6) for the first non-empty Row (section 2.4.221) is equal to the file position of the second Row record (the end of the first Row record) + rgdb. Other non-empty CELL records for the first row follow this first CELL record.
The file position of the first CELL record for the second non-empty Row is equal to the file position of the first CELL record for the first Row + rgdb. Other non-empty CELL records for the 2nd row follow this first CELL record.
The file position for the first CELL record for the third non-empty Row is equal to the file position of the first CELL record for the second Row + rgdb.
Read cell table data starting from the previously computed position.
Note that if the Row of the CELL record is known, it is possible to calculate the file position of the first CELL record of that Row first, and then get all the following CELL records without going through the first Row, the second Row, and so on.