The Name Class

class Name

Information relating to a named reference, formula, macro, etc.

  • New in version 0.6.0
  • Name information is **not* extracted from files older than Excel 5.0 (Book.biff_version < 50)*
Name.area2d(clipped=True)

This is a convenience method for the use case where the name refers to one rectangular area in one worksheet.

Parameters:
  • clipped (bool) – If True (the default), the returned rectangle is clipped to fit in (0, sheet.nrows, 0, sheet.ncols) – it is guaranteed that 0 <= rowxlo <= rowxhi <= sheet.nrows and that the number of usable rows in the area (which may be zero) is rowxhi - rowxlo; likewise for columns.
Returns:

a tuple (sheet_object, rowxlo, rowxhi, colxlo, colxhi).

Raises XLRDError:
The name is not a constant absolute reference to a single area in a single sheet.
Name.binary

0 = Formula definition; 1 = Binary data

No examples have been sighted.

Name.builtin

0 = User-defined name; 1 = Built-in name

(common examples: Print_Area, Print_Titles; see OOo docs for full list)

Name.cell()

This is a convenience method for the frequent use case where the name refers to a single cell.

Raises XLRDError:
The name is not a constant absolute reference to a single cell.
Name.complex

0 = Simple formula; 1 = Complex formula (array formula or user defined)

No examples have been sighted.

Name.func

0 = Command macro; 1 = Function macro. Relevant only if macro == 1

Name.funcgroup

Function group. Relevant only if macro == 1; see OOo docs for values.

Name.hidden

0 = Visible; 1 = Hidden

Name.macro

0 = Standard name; 1 = Macro name

Name.name

A string. If builtin, decoded as per OOo docs.

Name.name_index

The index of this object in book.name_obj_list

Name.raw_formula

An 8-bit string.

Name.result

The result of evaluating the formula, if any. If no formula, or evaluation of the formula encountered problems, the result is None. Otherwise the result is a single instance of the Operand class.

Name.scope
Value Description
-1 The name is global (visible in all calculation sheets).
-2 The name belongs to a macro sheet or VBA sheet.
-3 The name is invalid.
0 .. nsheets The name is local to the sheet whose index is scope.
Name.vbasic

0 = Sheet macro; 1 = VisualBasic macro. Relevant only if macro == 1

Previous topic

The Format Object

Next topic

The Operand Object

This Page