In the below code I am extracting data from SAP. In a few SAP reports I am running, occasionally data is not available, in which a pop up box appears, displaying
No Data Exists For Chosen Selection
I've implemented the below error handling strategy, which works fine when debugging and stepping into the code, but running in totality I receive this error on the asterik denoted line:
The Control Could Not Be Found By ID
session.findById("wnd[0]/tbar[1]/btn[8]").press
On Error GoTo ResumeInterCompany
**If session.findById("wnd[1]/tbar[0]").Text = "No data exists for chosen selection" Then**
GoTo TroubleShootInterCompany
End If
Any suggestions. I can provide more relevant code if need be.