In order to support For Each capabilities, the Procedure Id of the NewEnum function must be set to -4.

The Procedure Id can be set on the Procedure Attributes screen. Access this screen from the Tools menu or Object Browser (right click on the NewEnum procedure and select properties).