Forum Discussion

rbhogavalli's avatar
rbhogavalli
Occasional Contributor
10 years ago
Solved

Receiving Type mismatch error

Code: Sub Generate_Xmls Dim ColName(), new_nodes()  Dim Nodes()        'Array storing the current splited node names Dim NodeStack()    'Array storing the last node names ...
  • HKosova's avatar
    10 years ago
    Short answer: change

    to





    Long answer: Use Dim with parentheses only if you assign array elements manually, like this:



    Dim arr(5)

    For i = 0 To 5

      arr(i) = i

    Next

    If you use arrays returned by functions or subroutines, you need to Dim array variables without parentheses:



    Dim arr

    arr = Split("a b c", " ")