loading
 
Array Declaration Error
Anonymous
4 years
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  [1370 posts] 4 years
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.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index