Board index » Help Help » Technical Support




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Excel VBA 2007
PostPosted: Fri Oct 01, 2010 7:37 pm 
Offline
User avatar
Yeah Yeah Yeah
 Profile

Joined: Sat Oct 23, 2004 1:51 pm
Posts: 4329
Location: PA
I have VBA code in Excel 2003 that I need to get to work in Excel 2007. Can anyone help? The bolded line is the problem since 2007 doesn't support Application.FileSearch. The workarounds didn't work for me. I assume it's a simple fix.

Sub GetAllExcelFiles()
Dim sFolder As String
Dim lCounter As Long

sFolder = "M:\Thumb Drive\Scorecards"

With Application.FileSearch
.NewSearch
.LookIn = sFolder
.FileType = msoFileTypeExcelWorkbooks
.SearchSubFolders = True 'Set to false or exclude if you don't want subfolders
.Execute
End With

For lCounter = 1 To Application.FileSearch.FoundFiles.Count
Call MyRoutine(Application.FileSearch.FoundFiles(lCounter))
Next lCounter
End Sub

_________________
emanon wrote:
I think I either need to drink less to become more alert, or more so as not to care.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Board index » Help Help » Technical Support


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
It is currently Fri Mar 29, 2024 4:29 am