+ Reply to Thread
Results 1 to 1 of 1

Filesearch alternatives

  1. #1
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Filesearch alternatives

    The method 'Filesearch' has been removed from VBA since office 2007.

    If you only need to make an inventory in 1 folder you can use the VBA method 'dir' (see Ia) or the method 'files' from the 'scripting.filesystemobject'-library (see Ib).

    If you want to include subfolders you can use the method 'dir' from the 'Shell' library. (IIa and IIb)
    If you use this method VBA can only write the result to an ASCII-file. You can get this information by opening this file as an Excelfile (IIa) or read it as a 'freefile' (IIb).

    In these 4 examples the method to open a file fom the inventory is Getobject(filename); that's fast because it's completely hidden and it's multipurpose (opening Word, Excel, Access, etc. files)
    If you are dealing with Excelfiles you can also use workbooks.open (see IIIa) or workbooks.add (see IIIb)


    Ia
    Please Login or Register  to view this content.

    Ib
    Please Login or Register  to view this content.

    IIa
    Please Login or Register  to view this content.

    IIb
    Please Login or Register  to view this content.

    IIIa
    Please Login or Register  to view this content.

    IIIb
    Please Login or Register  to view this content.
    Last edited by snb; 08-26-2011 at 08:39 AM.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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