title: "Object cannot be identified" or "Object not visible" Run Error in QTP?
body: <p>WinObj either cannot be identified or is not visible when I run my script.</p>
  
  <p>BUT when I click "Debug" button in the error message box that appears, then open the object repository and <em>highlight in application</em> the WinObj, the WinObj gets highlighted. And when I resume running my script, the script runs fine --- the error doesn't occur anymore.</p>
  
  <p>How can I prevent this error from happening?</p>
  
  <p>UPDATE:
  My code goes roughly like this:</p>
  
  <pre><code>    Public Function getText( winObjObject, textArray )
          Dim textHolder
          textHolder = winObjObject.GetVisibleText() '' this is where the error occurs
          textArray = Split(textHolder, vbCrLf)
      End Function
  </code></pre>