Can you post the portion of the script that is giving you problems?

Likely are performing a function on the object that isn't supported. Certain functions will fail on COM objects, like...

code:
If LEN($Merlin) = 0
...blah
EndIf