public class Button extends Shape
Example
//Create a new Workbook.
Workbook workbook = new Workbook();
//Get the first worksheet in the workbook.
Worksheet sheet = workbook.getWorksheets().get(0);
//Add a new button to the worksheet.
Button button = sheet.getShapes().addButton(2, 0, 2, 0, 28, 80);
//Set the caption of the button.
button.setText("Aspose");
//Set the Placement Type, the way the
//button is attached to the cells.
button.setPlacement(PlacementType.FREE_FLOATING);
//Set the font name.
button.getFont().setName("Tahoma");
//Set the caption string bold.
button.getFont().setBold(true);
//Set the color to blue.
button.getFont().setColor(Color.getBlue());
//Set the hyperlink for the button.
button.addHyperlink("http://www.aspose.com/");
//Saves the file.
workbook.save("tstbutton.xls");
addHyperlink, alignTopRightCorner, calculateTextSize, characters, fitToTextSize, formatCharacters, getActiveXControl, getActualBox, getActualLowerRightRow, getAlternativeText, getAnchorType, getAutoShapeType, getBottom, getCharacters, getConnectionPoints, getControlData, getCreateId, getFill, getFillFormat, getFont, getFormatPicture, getGeometry, getGlow, getGroup, getHeight, getHeightCM, getHeightInch, getHeightInShape, getHeightPt, getHeightScale, getHtmlText, getHyperlink, getId, getInputRange, getInputRange, getLeft, getLeftCM, getLeftInch, getLeftInShape, getLeftToCorner, getLine, getLineFormat, getLinkedCell, getLinkedCell, getLockedProperty, getLowerDeltaX, getLowerDeltaY, getLowerRightColumn, getLowerRightRow, getMacroName, getMsoDrawingType, getName, getPaths, getPlacement, getReflection, getRelativeToOriginalPictureSize, getResultOfSmartArt, getRichFormattings, getRight, getRotationAngle, getShadowEffect, getSoftEdges, getSpid, getSpt, getText, getTextBody, getTextBoxOptions, getTextDirection, getTextEffect, getTextHorizontalAlignment, getTextHorizontalOverflow, getTextOptions, getTextOrientationType, getTextShapeType, getTextVerticalAlignment, getTextVerticalOverflow, getThreeDFormat, getTitle, getTop, getTopCM, getTopInch, getTopInShape, getTopToCorner, getType, getUpperDeltaX, getUpperDeltaY, getUpperLeftColumn, getUpperLeftRow, getWidth, getWidthCM, getWidthInch, getWidthInShape, getWidthPt, getWidthScale, getWorksheet, getX, getY, getZOrderPosition, hasLine, isAspectRatioLocked, isDecorative, isEquation, isFilled, isFlippedHorizontally, isFlippedVertically, isGroup, isHidden, isInGroup, isLockAspectRatio, isLocked, isPrintable, isRichText, isSameSetting, isSmartArt, isTextWrapped, isWordArt, moveToRange, removeActiveXControl, removeHyperlink, setAlternativeText, setAnchorType, setAspectRatioLocked, setAutoShapeType, setBottom, setCreateId, setDecorative, setFilled, setFlippedHorizontally, setFlippedVertically, setFont, setHasLine, setHeight, setHeightCM, setHeightInch, setHeightInShape, setHeightPt, setHeightScale, setHidden, setHtmlText, setInputRange, setInputRange, setLeft, setLeftCM, setLeftInch, setLeftInShape, setLeftToCorner, setLinkedCell, setLinkedCell, setLockAspectRatio, setLocked, setLockedProperty, setLowerDeltaX, setLowerDeltaY, setLowerRightColumn, setLowerRightRow, setMacroName, setName, setPlacement, setPrintable, setRelativeToOriginalPictureSize, setRight, setRotationAngle, setSoftEdges, setText, setTextDirection, setTextHorizontalAlignment, setTextHorizontalOverflow, setTextOptions, setTextOrientationType, setTextShapeType, setTextVerticalAlignment, setTextVerticalOverflow, setTextWrapped, setTitle, setTop, setTopCM, setTopInch, setTopInShape, setTopToCorner, setUpperDeltaX, setUpperDeltaY, setUpperLeftColumn, setUpperLeftRow, setWidth, setWidthCM, setWidthInch, setWidthInShape, setWidthPt, setWidthScale, setX, setY, setZOrderPosition, toFrontOrBack, toImage, toImage, toImage, updateSelectedValueSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.