I'm trying to close an open window in Moldflow.

The command
Synergy.Quit(Fa lse)
is working only if I use it directly after
Synergy = win32com.client .Dispatch("syne rgy.Synergy").

Else, if I use it after lots of other codes its not closing.
What should I write before the quit line in order for Moldflow to close?
Any idea(s) pls?