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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OverFlow Error in this function, cant solve

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
I get an overflow error in this function<br>
<br>
Private Function CleanUp(ByVal sFol As String, sFile As String, nDirs As Integer, nFiles As Integer) As Long<br>
Dim tFld As Folder, tFil As File, FileName As String<br>
Set fld = fso.GetFolder(sFol)<br>
FileName = Dir(fso.BuildPath(fld.Path, sFile), vbNormal Or vbHidden Or vbSystem Or vbReadOnly)<br>
While Len(FileName) &lt;&gt; 0<br>
CleanUp = CleanUp + FileLen(fso.BuildPath(fld.Path, FileName))<br>
nFiles = nFiles + 1<br>
List1.AddItem fso.BuildPath(fld.Path, FileName) ' Load ListBox<br>
FileName = Dir() ' Get next file<br>
DoEvents<br>
Wend<br>
Label1 = &quot;Searching &quot; & vbCrLf & fld.Path & &quot;...&quot;<br>
nDirs = nDirs + 1<br>
If fld.SubFolders.Count &gt; 0 Then<br>
For Each tFld In fld.SubFolders<br>
DoEvents<br>
If Left(tFld.Name, 1) = &quot;_&quot; Then List2.AddItem (tFld.Path)<br>
CleanUp = CleanUp + CleanUp(tFld.Path, sFile, nDirs, nFiles)<br>
Next<br>
End If<br>
End Function <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>
 
hehe, you know its funny, is that i figure that out before i got home, i need to spend just a lil more time before posting these questions <p>Karl<br><a href=mailto:kb244@bellsouth.net>kb244@bellsouth.net</a><br><a href= </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top