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
Name
Type: System.StringName of the connection.
Description
Type: System.StringBrief description about the connection.
ConnectionString
Type: System.ObjectThe connection string.
CommandText
Type: System.ObjectThe command text to create the connection.
lCmdtype
Type: System.ObjectCommand type.
Return Value
Type: Microsoft.Office.Interop.Excel.WorkbookConnection
WorkbookConnection