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
 

Graham182

New Member
Joined
Jan 31, 2010
Messages
31
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
Graham

What is the code meant to do?
 

Graham182

New Member
Joined
Jan 31, 2010
Messages
31
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?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
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.:)
 

taigovinda

Well-known Member
Joined
Mar 28, 2007
Messages
2,639
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...
 

Forum statistics

Threads
1,082,323
Messages
5,364,586
Members
400,808
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top