Re: Subscript OUT OF RANGE Error
- From: pmud <pmud@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 18 May 2006 07:02:01 -0700
Hi Jan,
Thanks.. That worked. I hjad not initialized my array. Now I modified my
code a little bit like th efollowing and it worked, :)
Private Sub btnUpload_Click()
Dim SubDir() As String
Dim i As Integer
Dim CountDir As Integer
CountDir = dirDirect.ListCount
ReDim SubDir(CountDir)
For i = 0 To CountDir - 1
SubDir(i) = dirDirect.List(i)
Next
For i = 0 To dirDirect.ListCount - 1
MsgBox SubDir(i)
Next
End Sub
--
pmud
"Jan Hyde" wrote:
pmud <pmud@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild thoughts were.
released on Thu, 18 May 2006 06:25:01 -0700 bearing the
following fruit:
Hi Karl,
I think I by chance wrote wrong here.
You should always post your exact code rather than typing it
out again.
I apologize. But in my code SubDirPath
i9s an array and still I am getting teh subscript out of range error. Below
is my corrcte code:
Private Sub btnUpload_Click()
Dim SubDirPath() As String
Dim i As Integer
For i = 0 To dirDirect.ListCount - 1
SubDirPath(i) = dirDirect.List(i) ---- ERROR HERE
Next
Anyhoo, where exactly do you initialise that array?
Jan Hyde (VB MVP)
--
The convicted architect discovered that prison walls were not made to scale. (Gary Hallock)
- References:
- Re: Subscript OUT OF RANGE Error
- From: Karl E. Peterson
- Re: Subscript OUT OF RANGE Error
- From: Jan Hyde
- Re: Subscript OUT OF RANGE Error
- Prev by Date: Re: Subscript OUT OF RANGE Error
- Next by Date: Re: Subscript OUT OF RANGE Error
- Previous by thread: Re: Subscript OUT OF RANGE Error
- Next by thread: Re: Subscript OUT OF RANGE Error
- Index(es):
Relevant Pages
|