Is there a running test in TestComplete at the moment? This article says it's a prerequisite for GetObjectByName
:
You can obtain the object only if TestComplete is running a test. If there is no tests running in TestComplete,
GetObjectByName
will return an empty Variant value.