YeshyTiger
New Member
- Joined
- Oct 21, 2008
- Messages
- 23
Hello,
My company had been using 2003 when I created a very large macro looped through files checking each one to a certain criteria. Now that we have upgraded to 2007, it does not recognize at least the first part of the macro that sets up the loop. Could anyone tell me why it is not recognizing the loop when it used to in 2003?
My company had been using 2003 when I created a very large macro looped through files checking each one to a certain criteria. Now that we have upgraded to 2007, it does not recognize at least the first part of the macro that sets up the loop. Could anyone tell me why it is not recognizing the loop when it used to in 2003?
Code:
Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook
Dim error As Integer
Dim psswrd As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Set wbCodeBook = ThisWorkbook
With Application.FileSearch
.NewSearch
'Change path to suit
.LookIn = "C:\Documents and Settings\JG\Desktop\PMP Input Folder"
.FileType = msoFileTypeExcelWorkbooks
.Filename = "*.xls"
If .Execute > 0 Then 'Workbooks in folder
For lCount = 1 To .FoundFiles.Count 'Loop through all.
'Open Workbook x and Set a Workbook variable to it
Set wbResults = Workbooks.Open(.FoundFiles(lCount))
.Select