Skip to main content

TdxSpreadSheetUseDefinedNameInFormula Class

Implements the UseDefinedNameInFormula end-user command available for spreadsheet controls.

Declaration

TdxSpreadSheetUseDefinedNameInFormula = class(
    TdxSpreadSheetCustomGalleryAction,
    IdxSpreadSheetListener,
    IdxSpreadSheetListener2
)

Remarks

This class does not introduce any new public members. Its overridden Execute function:

  • Creates a new formula expression that consists of the equals sign followed by a defined name clicked in the drop-down menu if the focused cell is empty.

  • Appends the plus operator followed by the clicked defined name to an existing formula expression in a focused cell.

  • Inserts the plus operator followed by the clicked defined name into an existing formula expression at the caret position in an active in-place cell editor.

UI elements linked to a TdxSpreadSheetUseDefinedNameInFormula action object are enabled only if the following conditions are met:

  • Spreadsheet document edit operations are allowed (that is, the control’s OptionsBehavior.Editing property is set to True).

  • The active worksheet is not protected (that is, its OptionsProtection.Protected property is set to False).

  • The opened spreadsheet document has at least one defined name.

  • A cell in the active worksheet has focus.

To localize the caption displayed by UI elements linked to a TdxSpreadSheetUseDefinedNameInFormula action object, use the sdxSpreadSheetActionUseDefinedNameInFormulaCaption resource string.

Note

Use automatic UI generation to create a functional gallery item associated with a TdxSpreadSheetUseDefinedNameInFormula action object.

See Also