There is something in the knowledge base that mentions this function can be a problem if another program is run that can handle DDE calls. It mentions IE as a possible culprit.
Has anything been upgraded recently by accident or design.
If you just turn the PC on and then run your code does it hang straightaway?
Which O/S is this ? Consistent across all machines? Does it work until you run something else?
Questions, questions...