UsedObjects Property [Excel 2003 VBA Language Reference]

Returns a UsedObjects object representing objects allocated in a workbook.

expression.UsedObjects

expression Required. An expression that returns one of the objects in the Applies To list.

Example

In this example, Microsoft Excel determines the quantity of objects that have been allocated and notifies the user. This example assumes a recalculation was performed in the application and was interrupted before finishing.

Sub CountUsedObjects()

    MsgBox "The number of used objects in this application is: " & _
        Application.UsedObjects.Count

End Sub

Applies to | Application Object