J
Joe
Dear All,
I am using Excel 2003 SP2 and VB 6.3
I am trying to use Excel to copy from the server, any new data that
has come.
for that I use "scripting.filesystemobject" to get the list of files.
See the code below.
'****************************************************************
Function FoldersInFolder(ByVal myFolderName As String, ByVal Col As
Integer)
Dim FSO As Object
Dim myBaseFolder As Object
Dim myFolder As Object
Dim R As Integer
Set FSO = CreateObject("scripting.filesystemobject")
Set myBaseFolder = FSO.GetFolder(myFolderName)
R = 2
For Each myFolder In myBaseFolder.SubFolders
rng_Folders(R, Col) = myFolder.Name ' write the folder name on to
the worksheet
R = R + 1
Next myFolder
End Function
'****************************************************************
This works fine except for the speed. When I connect this to the
server folder, it takes exceptionally long time. I assume that it is
because it searches iteratively through all the subfolders and the
files in those..
I have about 100 folders on server, each of which have 50 MB of data.
Seaching through all those 100 x 50 MB is going to be time
consuming......
The question that I have is .... Is it possible to search for just
the list of Folders in that level alone ?? Program need not have to
search for further subfolders and the files... Hope this is
possible...
something like ...
For Each myFolder In myBaseFolder.SubFolders(Level 1)
Thank you very much....
Regards
Joe
I am using Excel 2003 SP2 and VB 6.3
I am trying to use Excel to copy from the server, any new data that
has come.
for that I use "scripting.filesystemobject" to get the list of files.
See the code below.
'****************************************************************
Function FoldersInFolder(ByVal myFolderName As String, ByVal Col As
Integer)
Dim FSO As Object
Dim myBaseFolder As Object
Dim myFolder As Object
Dim R As Integer
Set FSO = CreateObject("scripting.filesystemobject")
Set myBaseFolder = FSO.GetFolder(myFolderName)
R = 2
For Each myFolder In myBaseFolder.SubFolders
rng_Folders(R, Col) = myFolder.Name ' write the folder name on to
the worksheet
R = R + 1
Next myFolder
End Function
'****************************************************************
This works fine except for the speed. When I connect this to the
server folder, it takes exceptionally long time. I assume that it is
because it searches iteratively through all the subfolders and the
files in those..
I have about 100 folders on server, each of which have 50 MB of data.
Seaching through all those 100 x 50 MB is going to be time
consuming......
The question that I have is .... Is it possible to search for just
the list of Folders in that level alone ?? Program need not have to
search for further subfolders and the files... Hope this is
possible...
something like ...
For Each myFolder In myBaseFolder.SubFolders(Level 1)
Thank you very much....
Regards
Joe