LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Filesearch error in Excel 2007

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSearch Excel 2007 shaz Excel Discussion (Misc queries) 4 March 21st 10 02:07 AM
Excel 2002 to 2007 Macro containing "Filesearch" dede Setting up and Configuration of Excel 3 December 4th 09 05:00 PM
Excel 2007 filesearch Libby Excel Programming 3 February 8th 08 06:53 PM
Application.FileSearch in 2007 Amery Excel Programming 2 December 13th 07 10:49 PM
replacement for filesearch in excel 2007 LWhite Excel Programming 1 September 10th 07 03:35 PM


All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"