Share via


Connections.Add Method (Excel)

Adds a new connction to the workbook.

Version Information

Version Added: Excel 2007

Syntax

expression .Add(Name, Description, ConnectionString, CommandText, lCmdtype)

expression A variable that represents a Connections object.

Parameters

Name

Required/Optional

Data Type

Description

Name

Required

String

Name of the connection.

Description

Required

String

Brief description about the connection.

ConnectionString

Required

Variant

The connection string.

CommandText

Required

Variant

The command text to create the connection.

lCmdtype

Optional

Variant

Command type.

Return Value

WorkbookConnection

See Also

Concepts

Connections Object Members

Connections Object