Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a sub that add files in a folder to a listbox. It worked fine in Excel 2003, but now in Excel 2007 it doesn't and I get an error. the code is below Sub Fill_Listbox strDir = path of folder ChrDir strDir With Application.Filesearch .NewSearch .LookIn = strDir .SearchSubFolders = False .FileType = msoFileTypeAllFiles If .Excecute() 0 Then For i = 1 to .FoundFiles.Count 'Add file name to listbox Next i end if End with I've stepped though and the error occurs at the With Application.FileSearch part. The error is Run-time error 445. Object doesn't support this action. Can anyone tell my why this doesn't work in Excel 2007 and if possible how to achieve the same results using Excel 2007? Many thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FileSearch Excel 2007 | Excel Discussion (Misc queries) | |||
Excel 2002 to 2007 Macro containing "Filesearch" | Setting up and Configuration of Excel | |||
Excel 2007 filesearch | Excel Programming | |||
Application.FileSearch in 2007 | Excel Programming | |||
replacement for filesearch in excel 2007 | Excel Programming |