Subscript out of range (Visual Basic)

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

An array subscript is not valid because it falls outside the allowable range. The lowest subscript value for a dimension is always 0, and the highest subscript value is returned by the GetUpperBound method for that dimension.

To correct this error

  • Change the subscript so it falls within the valid range.

Array.GetUpperBound
Arrays

Show: