Forum Discussion
I believe I resolved the problem in my code by moving one line. It seems to be stable but since the issue is erratic, I'll have to watch it for a while.
'Enter the menu name, number or file name and run it
If QADNetUI.Exists Then
Set SearchBar = QADNetUI.FindChild("ClrClassName", "UltraTextEditor", 20) '<---moved this line into the If/Then
With SearchBar
.SelectAll()
.keys"[Del]"
delay 2000
Log.Message("Menu Number = " &strMenuNumber)
.keys(strMenuNumber)
delay 2000
.keys"[Enter]"
End With
delay 3000
Else
Err.Raise 777, "selectMenu::QADNetUI.Exists", "Can not find SearchBar"
End If
Else
Err.Raise 778, "selectMenu::WaitWinFormObject(QAD.Client, TimeOut)", "Can not find QADNetUI"
End If
- tristaanogre6 years agoEsteemed Contributor
That makes sense, actually. The reason why you may be getting "object destroyed" error is that, if the "[Del]" call and other stuff you're doing within your If then is causing a screen reload. That would destroy the handle that SearchBar has and would need to have that object refreshed each time.
Related Content
Recent Discussions
- 2 hours agoSvetaG