ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ms excel 2007 Filesearch (https://www.excelbanter.com/excel-programming/410648-ms-excel-2007-filesearch.html)

Danny[_2_]

ms excel 2007 Filesearch
 
I have the following code developed in Excel 2002. I have noted from
this group that .Filesearch is not longer supported in ms excel 2007.

I would like for this code to search for text "budget" in all
workbooks and return the file and it's path to either a listbox or
compile a list of all of the files names and path into an Excel
Workbook.

I am kind of lost on reworking this code with VBA in MS Excel 2007.
Any suggestions you have would be greatly appreciated

Sub findfiles()
With Application.FileSearch


.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.TextOrProperty = "Budget"
.MatchTextExactly = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
UserForm1.ListBox1.AddItem.FoundFiles (i)
Next i
End With
UserForm1.Show


End Sub

dan dungan

ms excel 2007 Filesearch
 
From a February 8th post:

Newsgroups: microsoft.public.excel.programming
From: "Ron de Bruin"
Date: Fri, 8 Feb 2008 19:11:31 +0100
Local: Fri, Feb 8 2008 11:11 am
Subject: Filesearch error in Excel 2007

Hi Libby

It is removed from 2007

You can use Dir or FSO
See the merge code on my site, you can use that for your macro
http://www.rondebruin.nl/copy3.htm


Danny[_2_]

ms excel 2007 Filesearch
 
On May 8, 9:55*am, dan dungan wrote:
From a February 8th post:

Newsgroups: microsoft.public.excel.programming
From: "Ron de Bruin"
Date: Fri, 8 Feb 2008 19:11:31 +0100
Local: Fri, Feb 8 2008 11:11 am
Subject: Filesearch error in Excel 2007

Hi Libby

It is removed from 2007

You can use Dir or FSO
See the merge code on my site, you can use that for your macrohttp://www.rondebruin.nl/copy3.htm


Thanks I will take a look at your page. I appreciate your help.

D


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com