I have a macro in an Excel document that scrapes data from the Attachmate / Micro Focus Reflection application. It has been running fine for over a year, but we have now been updated company wide to Office 2016 and Reflection 16. There is now one specific routine that fails with a run-time error.
This code is part of a Sub that pulls data row by row from a particular screen, and this is the section of the sub that looks for a blank row which indicates the end of the data, and exits this sub. The GetNextOffset function does a data validation on each row to determine if the row will be used or skipped.
When I run the macro as is, everything works as expected until it reaches the blank row, and the end of the data on the screen. Then it throws the following error:
Run-time error ‘-2146233086 (80131502)’:Specified argument was out of the range of valid values.Parameter name: row
If I change the displayRow variable in each getString query to the actual row number for each row of data, the macro runs flawlessly.
Any thoughts as to what may be causing this error?
Code:
displayRow = GetNextOffset(displayRow + 1)
If hrn.getString(displayRow, 4, 1) = " " Or displayRow = 0 Then
hrn.MoveTo 1, 5
Exit Sub
End If
This code is part of a Sub that pulls data row by row from a particular screen, and this is the section of the sub that looks for a blank row which indicates the end of the data, and exits this sub. The GetNextOffset function does a data validation on each row to determine if the row will be used or skipped.
When I run the macro as is, everything works as expected until it reaches the blank row, and the end of the data on the screen. Then it throws the following error:
Run-time error ‘-2146233086 (80131502)’:Specified argument was out of the range of valid values.Parameter name: row
If I change the displayRow variable in each getString query to the actual row number for each row of data, the macro runs flawlessly.
Any thoughts as to what may be causing this error?
Last edited: