Compartilhar via


Shapes.AddDiagram Method

Creates a diagram. Returns a Shape object that represents the new diagram.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function AddDiagram ( _
    Type As MsoDiagramType, _
    Left As Single, _
    Top As Single, _
    Width As Single, _
    Height As Single _
) As Shape
'Usage
Dim instance As Shapes
Dim Type As MsoDiagramType
Dim Left As Single
Dim Top As Single
Dim Width As Single
Dim Height As Single
Dim returnValue As Shape

returnValue = instance.AddDiagram(Type, _
    Left, Top, Width, Height)
Shape AddDiagram(
    MsoDiagramType Type,
    float Left,
    float Top,
    float Width,
    float Height
)

Parameters

  • Type
    Type: Microsoft.Office.Core.MsoDiagramType

    Required MsoDiagramType. The type of diagram. Can be one of these MsoDiagramType constants:

    msoDiagramCycle A process diagram with a continuous cycle diagram type.

    msoDiagramMixed A mixed diagram type.

    msoDiagramOrgChart A hierarchical relationship diagram type.

    msoDiagramPyramid A foundation based relationships diagram type.

    msoDiagramRadial A diagram type showing relationships of a core element.

    msoDiagramTarget A diagram type showing steps toward a goal.

    msoDiagramVenn A diagram type showing areas of overlap between elements.

  • Left
    Type: System.Single

    Required Single. The position (in points) of the upper-left corner of the diagram relative to the upper-left corner of the worksheet.

  • Top
    Type: System.Single

    Required Single. The position (in points) of the upper-left top of the diagram relative to the upper-left corner of the worksheet.

  • Width
    Type: System.Single

    Required Single. The width of the diagram, in points.

  • Height
    Type: System.Single

    Required Single. The height of the diagram, in points.

Return Value

Type: Microsoft.Office.Interop.Excel.Shape

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Excel Namespace