How to use/replace DoEvents with 64 bit?

Found an interesting example of waiting for user action by Matthew Lorono. It works fine with 32bit XP but fails with 64bit Vista. There are following lines:

While sMgr.GetSelectedObjectCount < 1

  DoEvents

Wend

When running with 64bit, SolidWorks gets "locked" and it is not possible to select anything. So macro waits for selection and gets jummed too.

Any solution for 64 bit workstation?

SolidworksApi macros