Aspose::Cells::Drawing::Shape::SetLinkedCell method

Shape::SetLinkedCell(const U16String&) method

Gets or sets the worksheet range linked to the control’s value.

void Aspose::Cells::Drawing::Shape::SetLinkedCell(const U16String &value)

Examples

U16String val = u"A1";
if (shape.GetLinkedCell() == u"$B$6")
    shape.SetLinkedCell(val);

See Also

Shape::SetLinkedCell(const char16_t*) method

Gets or sets the worksheet range linked to the control’s value.

void Aspose::Cells::Drawing::Shape::SetLinkedCell(const char16_t *value)

Examples

if (shape.GetLinkedCell() == u"$B$6")
    shape.SetLinkedCell(u"A1");

See Also

Shape::SetLinkedCell(const U16String&, bool, bool) method

Sets the range linked to the control’s value.

void Aspose::Cells::Drawing::Shape::SetLinkedCell(const U16String &formula, bool isR1C1, bool isLocal)
ParameterTypeDescription
formulaconst U16String&The range linked to the control’s value.
isR1C1boolWhether the formula needs to be formatted as R1C1.
isLocalboolWhether the formula needs to be formatted by locale.

Examples

//After executing the code below, a ScrollBar object is created in the generated file. As you drag the slider, the value is displayed in cell A12.

//ActiveX Controls
//Aspose.Cells.Drawing.Shape scrollBar = book.GetWorksheets().Get(0).GetShapes().AddActiveXControl( Aspose.Cells.Drawing.ActiveXControls.ControlType::ScrollBar,2, 0, 2, 0, 30, 130);

//Form Controls
Shape scrollBar = book.GetWorksheets().Get(0).GetShapes().AddScrollBar(2, 0, 2, 0, 130, 30);

//Sets the range linked to the control's value.
U16String val = u"$A$12";
scrollBar.SetLinkedCell(val, false, true);

See Also

Shape::SetLinkedCell(const char16_t*, bool, bool) method

Sets the range linked to the control’s value.

void Aspose::Cells::Drawing::Shape::SetLinkedCell(const char16_t *formula, bool isR1C1, bool isLocal)
ParameterTypeDescription
formulaconst char16_t*The range linked to the control’s value.
isR1C1boolWhether the formula needs to be formatted as R1C1.
isLocalboolWhether the formula needs to be formatted by locale.

Examples

//After executing the code below, a ScrollBar object is created in the generated file. As you drag the slider, the value is displayed in cell A12.

//ActiveX Controls
//Aspose.Cells.Drawing.Shape scrollBar = book.GetWorksheets().Get(0).GetShapes().AddActiveXControl( Aspose.Cells.Drawing.ActiveXControls.ControlType::ScrollBar,2, 0, 2, 0, 30, 130);

//Form Controls
Shape scrollBar = book.GetWorksheets().Get(0).GetShapes().AddScrollBar(2, 0, 2, 0, 130, 30);

//Sets the range linked to the control's value.
scrollBar.SetLinkedCell(u"$A$12", false, true);

See Also