|
Array Declaration Error Anonymous |
10 year
|
I am getting a Type Mismatch error when declaring an array in VBScropt as follows
Dim myArray(29)
Does anyone know what I am doing wrong
|
|
|
Steven Gentner from United States [1446 posts] |
10 year
|
Try using
ReDim myArray(29)
instead. It has to do with the way the module is executed ... you are within a loop so the first time it sees a Dim you are ok, but will error the next time is sees it since myArray is already declared. Using ReDim gets around this issue.
STeven.
|
|