The following example uses the Collection and Count properties to return the number of objects the active project contains, when viewed as a collection of objects.
Debug.Print Application.VBE.ActiveVBProject.Collection.Count