LibreOffice: XNamedRanges Interface Reference

LibreOffice LibreOffice 7.4 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XNamedRanges Interface Referencepublished

provides access to the members in a collection of named ranges and to insert and remove them. More...

Inheritance diagram for XNamedRanges:

## Public Member Functions
void | addNewByName ([in] string aName, [in] string aContent, [in] com::sun::star::table::CellAddress aPosition, [in] long nType)
| adds a new named range to the collection.
void | addNewFromTitles ([in] com::sun::star::table::CellRangeAddress aSource, [in] com::sun::star::sheet::Border aBorder)
| creates named cell ranges from titles in a cell range.
void | removeByName ([in] string aName)
| removes a named range from the collection.
void | outputList ([in] com::sun::star::table::CellAddress aOutputPosition)
| writes a list of all named ranges into the document.
Public Member Functions inherited from XNameAccess
any | getByName ([in] string aName) raises ( com::sun::star::container::NoSuchElementException, com::sun::star::lang::WrappedTargetException )
sequence< string > | getElementNames ()
boolean | hasByName ([in] string aName)
Public Member Functions inherited from XElementAccess
type | getElementType ()
boolean | hasElements ()
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Detailed Description

provides access to the members in a collection of named ranges and to insert and remove them.

See also
  com::sun::star::sheet::NamedRanges
  com::sun::star::sheet::NamedRange

Developers Guide
  Spreadsheet Documents - Named Ranges

## Member Function Documentation

## ◆ addNewByName()

void addNewByName | ( | [in] string | aName,
|  | [in] string | aContent,
|  | [in] com::sun::star::table::CellAddress | aPosition,
|  | [in] long | nType
| ) |  |

adds a new named range to the collection.

Parameters

  aName | the new name of the named range.
  aContent | the formula expression.

A cell range address is one possible content of a named range.

Parameters

  aPosition | specifies the base address for relative cell references.
  nType | a combination of flags that specify the type of a named range, as defined in NamedRangeFlag.

This parameter will be zero for any common named range.

## ◆ addNewFromTitles()

void addNewFromTitles | ( | [in] com::sun::star::table::CellRangeAddress | aSource,
|  | [in] com::sun::star::sheet::Border | aBorder
| ) |  |

creates named cell ranges from titles in a cell range.

The names for the named ranges are taken from title cells in the top or bottom row, or from the cells of the left or right column of the range (depending on the parameter aBorder. The named ranges refer to single columns or rows in the inner part of the original range, excluding the labels.

Example: The source range is A1:B3. The named ranges shall be created using row titles. This requires Border::TOP for the second parameter. The method creates two named ranges. The name of the first is equal to the content of cell A1 and contains the range $Sheet.$A$2:$A$3 (excluding the title cell). The latter named range is named using cell B1 and contains the cell range address $Sheet.$B$2:$B$3.

Parameters

  aSource | the cell range used to create the named ranges.
  aBorder | specifies the location of the title cells.

## ◆ outputList()

void outputList | ( | [in] com::sun::star::table::CellAddress | aOutputPosition | ) |

writes a list of all named ranges into the document.

The first column of the list contains the names. The second column contains the contents of the named ranges.

Parameters

  aOutputPosition | specifies the top left cell of the output range.

## ◆ removeByName()

void removeByName | ( | [in] string | aName | ) |

removes a named range from the collection.

The documentation for this interface was generated from the following file:

- com/sun/star/sheet/XNamedRanges.idl