If you comment out the database functionality in the second script, do you still get only 16 apps listed?

I just tested your script, and they indeed return a different number of applications. The error must be somewhere in your enumeration. Can you rewrite the enumeration as a UDF that returns the list of applications in an array?
_________________________
There are two types of vessels, submarines and targets.