Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subscript out of range

Status
Not open for further replies.

Killa

Programmer
Oct 19, 2001
56
US
I am getting a subscript out of range error when i redim the pdf_index array.

what anm i doing wrong ?

Thanks
killa

Sub get_issues()
Static x, y
For i = 0 To File2.ListCount
PDF_file_issue = UCase(getissue(File2.List(i)))
no_hit = True
For j = 1 To arraymax
If pdf_Index(j, 1) = PDF_file_issue Then
no_hit = False
pdf_Index(j, 2) = UCase(CStr(CInt(pdf_Index(j, 2) + 1)))
End If
Next j
If no_hit = True Then
arraymax = arraymax + 1
ReDim Preserve pdf_Index(arraymax, 2)
pdf_Index(j, 1) = PDF_file_issue
pdf_Index(j, 2) = "1"
End If
Next i
End Sub
 
The VBA help on ReDim clearly says that only the last dimension may be changed with Preserve.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top