question

Upvotes
1 0 0 1

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.

json
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
39.2k 75 11 27

@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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea