question

Upvotes
1 0 1 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 512.0 KiB each and 1.0 MiB total.

Hello @evan,

We would like to help.

Please provide more details, as requested by @Alex Putkov.

Thanks,

-AHS

Hello @evan,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

1 Answer

· Write an Answer
Upvotes
39.4k 77 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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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