SAP UI Error Handling in Excel VBA

I am trying to Automate Excel, by getting some data from SAP through Add-Ins imported. 

Some of the time the details are well populated but some other times the details are actually not available with the SAP Add-in driver and thus results in error generation.

I am sharing a code snippet below, and i need some support to add SAP UI based error handling so that whenever there is no data, that can be properly handled by the VBA code, instead of abnormal app termination.

If Session.FindById("wnd[0]/sbar").Text = "Text to search - " & "data not found" Then
  objSheet.Cells(2, 3).Value = Session.FindById("wnd[0]/sbar").Text
End If