When I execute the following code:
I get:Code:Dim NumFiles As Integer
NumFiles = List1.ListCount
Dim Files(NumFiles) As Integer
Error: Constant Expression Required
Why???
Printable View
When I execute the following code:
I get:Code:Dim NumFiles As Integer
NumFiles = List1.ListCount
Dim Files(NumFiles) As Integer
Error: Constant Expression Required
Why???
Dim Files() as Integer
...
Redim Files(NumFiles)
You can't give variable bounds to a fixed-length array. Use a dynamic array instead:
VB Code:
Dim NumFiles As Integer NumFiles = List1.ListCount Dim Files() As Integer ReDim Files(NumFiles)
Dammit! got beat again:D