+ Reply to Thread
Results 1 to 3 of 3

runtime error 445 - Set Search = Application.FileSearch

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Niksic, montenegro
    MS-Off Ver
    Excel 2010
    Posts
    2

    runtime error 445 - Set Search = Application.FileSearch

    Can someone help me please.. I need to make this macro work in excel 2010...

    thanx in advance


    Function FileList(folder As String, match As String, subfolders As Boolean)

    Dim list() As String, file As String
    Dim i As Integer
    i = 0
    Set Search = Application.FileSearch
    With Search
    .NewSearch
    .LookIn = folder
    .Filename = match
    .SearchSubFolders = subfolders
    total = .Execute()
    If total > 0 Then
    ReDim list(total - 1)
    For Each el In .FoundFiles
    file = CStr(el)
    list(i) = file
    i = i + 1
    Next
    Else
    ReDim list(0)
    list(0) = "()"
    End If
    End With
    FileList = list()
    Set Search = Nothing
    End Function

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: runtime error 445 - Set Search = Application.FileSearch

    Application.FileSearch was dropped in Excel 2007. You'll need to replace it with Scripting.FileSystemObject or something similar.

    Have a look on Chip Pearson's or Ron de Bruin's websites for ideas.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: runtime error 445 - Set Search = Application.FileSearch

    Application.FileSearch hasn't been available in Excel since, I think, Excel 2007.

    What is is you are trying to do with the code?

    PS Please use code tags when posting code.
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Runtime error 458 on Application.Run (??)
    By secret2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-12-2019, 04:32 AM
  2. With Application.Filesearch error in Excel 2010 VBA
    By santhisrinivas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2013, 05:11 AM
  3. [SOLVED] With Application.FileSearch error
    By gnoke in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-13-2011, 07:49 AM
  4. Application.FileSearch Error 2007 Excel
    By Vlad999 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2009, 07:46 PM
  5. Search using 'Application.FileSearch' ONLY lowercase filename
    By aph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-16-2006, 04:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1