Share via


OLEDBConnection.MakeConnection Method (Excel)

Establishes a connection for the specified OLE DB connection.

Version Information

Version Added: Excel 2007

Syntax

expression .MakeConnection

expression A variable that represents an OLEDBConnection object.

Return Value

Nothing

Remarks

The MakeConnection method can be used when a connection drops and the user wants to reestablish the connection.

Various objects and methods might return a run-time error if the connection is dropped. Use of this method assures a connection before executing other objects or methods.

Note

Microsoft Excel might drop a connection temporarily in the course of a session (unknown to the VBA programmer), so this method proves useful.

This method will result in a run-time error if the MaintainConnection property of the specified OLE DB connection has been set to False.

See Also

Concepts

OLEDBConnection Object Members

OLEDBConnection Object