OLEDBConnection.IsConnected (Excel)

Returns True if the MaintainConnection property is True. Returns False if it is not currently connected to its source.

The IsConnected property does not check to see if the connection is connected. Even if this property returns True, sending commands to the provider could result in an error if the connection is no longer valid.


Dim booIsConnected As Boolean
booIsConnected = ActiveWorkbook.Connections(1).OLEDBConnection.IsConnected