ducktapeonmydesk
New Member
- Joined
- Jul 5, 2017
- Messages
- 14
I am having an issue with a bit of script where an error handler will be called when there is no error.
This script is pulling data from SAP. The way I want it to work is when there is no data to be found, the error handler is called. While that is working, occasionally, the error handler will be called even when there is data in SAP.
Does anyone have any insight to what may be going on?
The error number is 619 and is highlighting the line
When no data is found in SAP, a message box comes up stating so, and this line hits the check mark box, the intent to be moving on to the next cell in the spreadsheet. However, this box doesn't appear when there actually is data.
This script is pulling data from SAP. The way I want it to work is when there is no data to be found, the error handler is called. While that is working, occasionally, the error handler will be called even when there is data in SAP.
Does anyone have any insight to what may be going on?
Code:
'Go to Print Preview
On Error GoTo ErrHandler
session.findById("wnd[0]").sendVKey 46
'Resize 'ship-to' column
session.findById("wnd[0]/mbar/menu[3]/menu[2]/menu[0]").Select
session.findById("wnd[1]/usr/tabsTS_LINES/tabpLI01/ssubSUB810:SAPLSKBH:0810/tblSAPLSKBHTC_WRITE_LIST/txtGT_WRITE_LIST-OUTPUTLEN[2,1]").Text = "10"
session.findById("wnd[1]/tbar[0]/btn[0]").press
'Extract data as a text file
session.findById("wnd[0]/tbar[1]/btn[45]").press
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = cl.Value & ".txt"
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = NewFolder
session.findById("wnd[1]/tbar[0]/btn[0]").press
GoTo NextVendor
'If there is no data available, make note to broaden criteria
ErrHandler:
session.findById("wnd[1]/tbar[0]/btn[0]").press
cl.ClearContents
End If
Err.Clear
Resume NextVendor
The error number is 619 and is highlighting the line
Code:
session.findById("wnd[1]/tbar[0]/btn[0]").press
When no data is found in SAP, a message box comes up stating so, and this line hits the check mark box, the intent to be moving on to the next cell in the spreadsheet. However, this box doesn't appear when there actually is data.
Last edited: