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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 Worksheet/Workbook Stream<br />

• External Names<br />

In <strong>Excel</strong>, formulas can use defined names located in another workbook, called “external names”. In this case for each<br />

name an EXTERNALNAME record (➜5.39) occurs after the EXTERNALBOOK record. <strong>The</strong> EXTERNALNAME<br />

record contains the name itself and the one-based index to the sheet name of the EXTERNALBOOK record. Again the<br />

index zero indicates a global name. If an EXTERNALBOOK contains external names, a special REF entry will be<br />

created in the EXTERNSHEET record. It contains the index to the EXTERNALBOOK and the sheet range –2…–2.<br />

Inside of a formula an external name is represented by the token tNameX (➜3.9.14). It contains the index to the special<br />

REF entry inside of the EXTERNSHEET record and the index to an EXTERNALNAME record (one-based).<br />

Example: A document contains the formulas<br />

=example.xls!GlobalName (location: ExtSheet3!C33; contents: 33),<br />

=[example.xls]ExtSheet3!LocalName (location: ExtSheet1!B22; contents: “ABCD”), and<br />

=[example.xls]ExtSheet1!LocalName (location: ExtSheet1!A11; contents: 11).<br />

EXTERNALBOOK 0<br />

EXTERNALNAME 1<br />

EXTERNALNAME 2<br />

EXTERNALNAME 3<br />

XCT<br />

Document = “example.xls”<br />

Sheet 0 = “ExtSheet1”<br />

Sheet 1 = “ExtSheet2”<br />

Sheet 2 = “ExtSheet3”<br />

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

Formula = “=[example.xls]ExtSheet3!C33”<br />

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

Formula = “=[example.xls]ExtSheet1!B22”<br />

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

Formula = “=[example.xls]ExtSheet1!A11”<br />

Number of CRN = 2, sheet = 0 (ExtSheet1)<br />

CRN 0 Cell range = A11, contents = 11<br />

CRN 1<br />

XCT<br />

Cell range = B22, contents = “ABCD”<br />

Number of CRN = 1, sheet = 2 (ExtSheet3)<br />

CRN 0 Cell range = C33, contents = 33<br />

EXTERNSHEET<br />

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

All formulas in the example above contain the token tNameXV with a reference to REF 0 in the EXTERN-<br />

SHEET record. REF 0 refers to EXTERNALBOOK 0 with the special sheet indexes for defined names.<br />

<strong>The</strong>refore the EXTERNALNAME records of EXTERNALBOOK 0 are used.<br />

<strong>The</strong> token of the first formula refers to EXTERNALNAME 1, the token of the second formula refers to EXTER-<br />

NALNAME 2, and the token of the last formula refers to EXTERNALNAME 3.<br />

• Add-In Functions<br />

If a workbook uses add-in functions, a special EXTERNALBOOK containing the byte sequence 01 H 3A H will occur. It<br />

is followed by the names of all used add-in functions, each inside of an EXTERNALNAME record. A special REF entry<br />

with the sheet range –2…–2 will be inserted into the EXTERNSHEET reference list.<br />

Example: A document contains the formulas =ISODD(1) and =ISEVEN(1).<br />

EXTERNALBOOK 0<br />

EXTERNALNAME 1<br />

EXTERNALNAME 2<br />

EXTERNSHEET<br />

01 H 3A H (add-in)<br />

Name = “ISODD”<br />

Name = “ISEVEN”<br />

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

<strong>The</strong> add-in function names are represented by tNameXR tokens in the formula, here referring to REF 0 and to<br />

the respective EXTERNALNAME record. <strong>The</strong> token is the first argument of the EXTERN.CALL function,<br />

which invokes the call of the add-in function.<br />

108

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

Saved successfully!

Ooh no, something went wrong!