Runtime.ObjectCount

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aRuntime.ObjectCount

Supported for all project types and targets.

Returns the current number of objects in existence.