Forum Discussion

DenisMedvedev's avatar
DenisMedvedev
Contributor
8 years ago
Solved

How to skip unable to find object error?

I'm trying to use bellow options for getting value from text fields, because I'm not sure which option will return me value.

 

obj["wText property"]
obj.getText().OleValue

But I have "unable to find object error" in case if any of them not exists.

 

I can't use try cath, because "unable to find object" actially is not an error. In this case, I will have error - "Unable to find the object wText. See Additional Information for details."

 

OnLogError Event also doesn't help.

 

I was trying to use 

DebugAgent.AdvancedExceptionHandling = false;

and it also led to the same error. 

 

So my question is how to skip this error?

 

Thanks in advance,

Denis 

  • tristaanogre's avatar
    tristaanogre
    8 years ago

    My bad... I see you already tried that.

     

    I'll confess, I'm unfamiliar with the syntax that you're using.  However, what it looks like is you're trying to determine whether or not the wText property is available on the object.  Have you considered using aqObject.IsSupported?  You could then put logic in to do something like

     

    if aqObject.IsSupported(obj, "wText") then
    {
        obj.getText().OleValue
    }

    Or something like that... The idea is that you're trying to figure out which property to use for getting the text. So, use a method available to determine if the property is supported and work with that.

5 Replies

  • I found workaround 

    Log.Enabled = false;

    works for now, but I'm interested if we have another way to ignore the issue?

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Wrap your call to use the object with a try/catch.  That way you'll handle the error if it happens and you can opt to not log anything in the "catch" block.

      • DenisMedvedev's avatar
        DenisMedvedev
        Contributor

        I can't use try cath, because "unable to find object" actially is not an error.