Skip to content

Files

Latest commit

 

History

History
57 lines (42 loc) · 1.54 KB

Excel.Shape.ConnectionSiteCount.md

File metadata and controls

57 lines (42 loc) · 1.54 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Shape.ConnectionSiteCount property (Excel)
vbaxl10.chm636093
vbaxl10.chm636093
Excel.Shape.ConnectionSiteCount
a1ee6e8f-7e3d-4ef8-49e8-e4c328e4fff1
05/14/2019
medium

Shape.ConnectionSiteCount property (Excel)

Returns the number of connection sites on the specified shape. Read-only Long.

Syntax

expression.ConnectionSiteCount

expression An expression that returns a Shape object.

Example

This example adds two rectangles to myDocument and joins them with two connectors. The beginnings of both connectors attach to connection site one on the first rectangle; the ends of the connectors attach to the first and last connection sites of the second rectangle.

Set myDocument = Worksheets(1) 
Set s = myDocument.Shapes 
Set firstRect = s.AddShape(msoShapeRectangle, _ 
 100, 50, 200, 100) 
Set secondRect = s.AddShape(msoShapeRectangle, _ 
 300, 300, 200, 100) 
lastsite = secondRect.ConnectionSiteCount 
With s.AddConnector(msoConnectorCurve, _ 
 0, 0, 100, 100).ConnectorFormat 
 .BeginConnect ConnectedShape:=firstRect, _ 
 ConnectionSite:=1 
 .EndConnect ConnectedShape:=secondRect, _ 
 ConnectionSite:=1 
End With 
With s.AddConnector(msoConnectorCurve, _ 
 0, 0, 100, 100).ConnectorFormat 
 .BeginConnect ConnectedShape:=firstRect, _ 
 ConnectionSite:=1 
 .EndConnect ConnectedShape:=secondRect, _ 
 ConnectionSite:=lastsite 
End With

[!includeSupport and feedback]