07.05.2014 Views

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.10 Internal and External References<br />

• Internal Names<br />

All internal names are stored in a list of DEFINEDNAME records (➜5.33) that follows the EXTERNSHEET record.<br />

<strong>The</strong>re exist two types of internal names: global names which are valid in the whole workbook and local names which are<br />

attached to a specific sheet. For instance the local name “MyCell” of the sheet “Sheet1” can be used from everywhere in<br />

the workbook by entering =Sheet1!MyCell. Each DEFINEDNAME record contains the name itself and a onebased<br />

sheet index. <strong>The</strong> index zero indicates a global name. If the document contains local names, a special REF entry<br />

will be created in the EXTERNSHEET record. It contains the index to the internal EXTERNALBOOK and the sheet<br />

range –2…–2.<br />

Inside of a formula a global name or a local name of the own sheet is represented by the token tName (➜3.9.1) with a<br />

one-based index to the DEFINEDNAME record list. Local names from other sheets (with explicitly denoted sheet name)<br />

are represented by the token tNameX (➜3.9.14) with an index to the special REF entry of the EXTERNSHEET record<br />

and an index to the DEFINEDNAME record list.<br />

In defined names, only 3D references are allowed. <strong>The</strong> special syntax =! allowed in defined names only<br />

( being a 2D cell reference or range reference) makes it possible to refer to cells or ranges in the same<br />

sheet that contains the formula cell with the defined name.<br />

Example for internal names: A document contains the global name “GlobalName”, and the local names “Sheet1!<br />

LocalName” and “Sheet2!LocalName”. In “Sheet1” there are the formulas<br />

=GlobalName,<br />

=LocalName,<br />

=Sheet1!LocalName, and<br />

=Sheet2!LocalName.<br />

<strong>The</strong> defined name “GlobalName” contains the formula<br />

=!$A$1.<br />

EXTERNALBOOK 0 Number of sheets: 3<br />

01 H 04 H (own workbook)<br />

EXTERNALBOOK 1 Number of sheets: 0<br />

Document = “” (Current sheet for defined names, ➜2.5.9)<br />

EXTERNSHEET<br />

DEFINEDNAME 1<br />

DEFINEDNAME 2<br />

DEFINEDNAME 3<br />

REF 0 = {EXTERNALBOOK = 0, sheet range = 0…0}<br />

REF 1 = { EXTERNALBOOK = 0, sheet range = –2…–2}<br />

REF 2 = { EXTERNALBOOK = 1, sheet range = –2…–2}<br />

Name = “GlobalName”, sheet (one-based) = 0 (Global)<br />

Formula = tRef3d token to REF 2 (➜3.9.15)<br />

Name = “LocalName”, sheet (one-based) = 1 (Sheet1)<br />

Name = “LocalName”, sheet (one-based) = 2 (Sheet2)<br />

<strong>The</strong> first formula in the example above contains the token tNameV referring to DEFINEDNAME 1 and the<br />

second formula the same token referring to DEFINEDNAME 2.<br />

<strong>The</strong> two latter formulas contain the token tNameXV with a reference to REF 1 in the EXTERNSHEET record.<br />

REF 1 refers to EXTERNALBOOK 0 with the special sheet indexes for defined names. <strong>The</strong> token of the third<br />

formula refers to DEFINEDNAME 2 and the token of the last formula refers to DEFINEDNAME 3.<br />

107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!