Connections.Add2(String, String, Object, Object, Object, Object, Object) Connections.Add2(String, String, Object, Object, Object, Object, Object) Method

Definition

Adds a new connection to the workbook.

public Microsoft.Office.Interop.Excel.WorkbookConnection Add2 (string Name, string Description, object ConnectionString, object CommandText, object lCmdtype, object CreateModelConnection, object ImportRelationships);
Public Function Add2 (Name As String, Description As String, ConnectionString As Object, CommandText As Object, Optional lCmdtype As Object, Optional CreateModelConnection As Object, Optional ImportRelationships As Object) As WorkbookConnection

Parameters

Name
String String

Name of the connection.

Description
String String

Brief description about the connection.

ConnectionString
Object Object

The connection string.

CommandText
Object Object

The command text to create the connection.

lCmdtype
Object Object

Command type.

CreateModelConnection
Object Object

Specifies whether to create a connection to the PowerPivot model.

ImportRelationships
Object Object

Specifies whether to import any existing relationships.

Returns

Applies to