Marco Directory Search Problem from excel 2000 to 2007

Graham182

New Member
Joined
Jan 31, 2010
Messages
31
Hi i've just upgraded my Excel from 2000 to 2007 and now this macro have stop working


Sub Dirlist()
Dim i As Long
With Application.FileSearch
.NewSearch
' *** Change Folder name to suit ***
.LookIn = "C:\My Documents"
.SearchSubFolders = True

Dir (Folder & "\" & Extension)
.Filename = "*.xls*"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = Right(.FoundFiles(i), InStr(StrReverse(.FoundFiles(i)), "\") - 1)
Next

End If
End With
End Sub

it stops at 'With Application.FileSearch' and i'm not sure what to put in inorder for it to carry on working
it used to look through all my MyDocuments and pick out any XLS files
can anyone help :)
Thanks
Graham
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Look at the Attached it seems that Application.FileSearch is no longer avalible, i'm unfortuatly not great with macro's but know my way around a bit.

in this i've try to copy what 'NatoC' was saying but it seem he was trying to rename all these files. but when i'm trying to copy any of this myself it isn't working.

I'm guessing there's no quick fix, but is there any other search which would pull up all the .Xls filenames in the folder and subfolders

Thanks
Graham
 
Upvote 0
Graham

What is the code meant to do?
 
Upvote 0
Re: Macro Directory Search Problem from excel 2000 to 2007

Ok i'm not that good at macro's and this is my slight problem, I understood my old macros.
But what i'm ultimatly trying to do is create a macro
that will list all the Excel filename in a folder and subfolder.
that will work in 2007?
as the macro i listed above stopped working what i upgraded to 2007.

I can't install any tool as its a works PC.

If anyone has a simple way?
 
Upvote 0
Re: Macro Directory Search Problem from excel 2000 to 2007

Graham

Can you tell us what you are actually trying to achieve?

Without knowing that all we can do is guess and then make suggestions based on those guesses.:)
 
Upvote 0
Re: Macro Directory Search Problem from excel 2000 to 2007

If I were you, I'd consider installing the linked material in post #5 on my home machine, then copying the code and re-creating the program on my work computer. I've never actually used it, but I read the intro and Chip said you can view all the code once you run the add-in...
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top