Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello MB, You should check that the .FoundFiles.Count is not zero. If it is I suspect .FoundFiles(i) object returns a Null. The .AddItem method will fail if the item is not a string. Try this... Code: -------------------- Sub FindFiles() With Application.FileSearch .NewSearch .LookIn = "D:\AllData\APICS" .SearchSubFolders = True .TextorProperty = "APICS Dictionary" .MatchTextExactly = True .Filename = "*.xls" .Execute For i = 1 to .FoundFiles.Count If .FoundFiles.Count = 0 Then Exit Sub UserForm1.ListBox1.AddItem .FoundFiles(i) Next i End With UserForm1.Show End Sub -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=479954 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with Userforms | Excel Discussion (Misc queries) | |||
Userforms | Excel Programming | |||
Userforms | Excel Programming | |||
Userforms..... | Excel Programming | |||
Userforms | Excel Programming |