Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.49 KB

Excel.ConnectorFormat.EndDisconnect.md

File metadata and controls

50 lines (34 loc) · 1.49 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ConnectorFormat.EndDisconnect method (Excel)
vbaxl10.chm646076
vbaxl10.chm646076
Excel.ConnectorFormat.EndDisconnect
518345b5-c287-6183-93ae-61c5b56fb9a5
04/23/2019
medium

ConnectorFormat.EndDisconnect method (Excel)

Detaches the end of the specified connector from the shape it's attached to. This method doesn't alter the size or position of the connector; the end of the connector remains positioned at a connection site but is no longer connected.

Use the BeginDisconnect method to detach the beginning of the connector from a shape.

Syntax

expression.EndDisconnect

expression A variable that represents a ConnectorFormat object.

Example

This example adds two rectangles to myDocument, attaches them with a connector, automatically reroutes the connector along the shortest path, and then detaches the connector from the rectangles.

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) 
set c = s.AddConnector(msoConnectorCurve, 0, 0, 0, 0) 
with c.ConnectorFormat 
 .BeginConnect firstRect, 1 
 .EndConnect secondRect, 1 
 c.RerouteConnections 
 .BeginDisconnect 
 .EndDisconnect 
End With

[!includeSupport and feedback]