0

I work in VBA. I converted Javascript Array to VB Array. To be honest it is not 100% vba array...It looks as in attached picture.

I would like to access directly individual items from this array/list. I tried:

  1. Msgbox ConvertedArray(1,1) doesn't work
  2. Msgbox ConvertedArray(1).Item("1") doesn't work

All what is working is counting the size of this "array" by writing

 For each Item in ConvertedArray
 ItemNo = ItemNo+1
 Next

Do you have any clue what is wrong with that array?

enter image description here

2
  • 1
    ConvertedArray(1)(1) or ConvertedArray(1).Item(1) Commented Feb 13, 2017 at 14:18
  • Possible duplicate of How to access a element in JavaScript array? Commented Aug 29, 2018 at 13:57

1 Answer 1

0

its the multidimensional array, you will need to access it through index element and not by item string

ConvertedArray(1)(1)

or

ConvertedArray(1).Item(1)

should work for you

Sign up to request clarification or add additional context in comments.

2 Comments

Unfortunately it doesn't work. Normal array has diffrent structure. Example: arr(0): -arr(0,0) -arr(0,1) - arr(0,2), arr(1): -arr(1,0), -arr(1,1) etc.
could you provide your code where you have created/Converted ConvertedArray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.