Partager via


Connections.Add Method

Adds a new connction to the workbook.

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

Syntax

'Declaration
Function Add ( _
    Name As String, _
    Description As String, _
    ConnectionString As Object, _
    CommandText As Object, _
    lCmdtype As Object _
) As WorkbookConnection
'Usage
Dim instance As Connections
Dim Name As String
Dim Description As String
Dim ConnectionString As Object
Dim CommandText As Object
Dim lCmdtype As Object
Dim returnValue As WorkbookConnection

returnValue = instance.Add(Name, Description, _
    ConnectionString, CommandText, lCmdtype)
WorkbookConnection Add(
    string Name,
    string Description,
    Object ConnectionString,
    Object CommandText,
    Object lCmdtype
)

Parameters

  • Description
    Type: System.String

    Brief description about the connection.

  • CommandText
    Type: System.Object

    The command text to create the connection.

Return Value

Type: Microsoft.Office.Interop.Excel.WorkbookConnection
WorkbookConnection

See Also

Reference

Connections Interface

Connections Members

Microsoft.Office.Interop.Excel Namespace