How can I detect when a value pair is not present in response from server

Hi

My VB program crashes occasionally when a result does not exist. For example:

For n = 0 To 5

If theRunner(0).result(0).runners(0).ex.availableToLay(n).price > 10 Then………………………

Next n

Sometimes only ex.availableToLay(0),ex.availableToLay(1) are present if the response from server.

How can I check if it exists without crashing prog.

I tried:

If theRunner(0).result(0).runners(0).ex.availableToLay(n).price = NOTHING Then………………

But this crashes.

Thanks.

Tagged:

Answers

  • @evan
    It's not clear from your question which Refinitiv product or API you're using. Would you mind specifying? Otherwise your question appears to be about determining the size of an array to avoid subscript out of range error in VBA, which would be a general programming in VBA question and off topic on this forum dedicated to Refinitiv APIs.