Class OLEDBErrors (Excel VBA)

A collection of OLEDBError objects. To use a OLEDBErrors class variable it first needs to be instantiated, for example


Dim oles as OLEDBErrors
Set oles = Application.OLEDBErrors

For Each

Here is an example of processing the OLEDBErrors items in a collection.


Dim oleer As OLEDBError
For Each oleer In Application.OLEDBErrors
	
Next oleer

Count

Returns a Long value that represents the number of objects in the collection.


Dim lngCount As Long
lngCount = Application.OLEDBErrors.Count

Item

Returns a single object from a collection.

Item (Index)

Index: The index number for the object.


Dim oleer As OLEDBError
Set oleer = Application.OLEDBErrors(Index:=1)