View Single Post
 
Old 12-26-2013, 07:20 PM
fredang fredang is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Dec 2013
Posts: 1
fredang is on a distinguished road
Default Urgent help needed for 2003 Macro to run in Excel 2007

Hi,
We just switch over from office 2003 to 2007 and have problem running 1 of the macro.
The person who wrote the macro have left the company & I am at a lost of how to get the macro running.
Reading through the various forums & help pages, it seems that the "FileSearch" portion is the source of the problem but I don't know how to make the necessary amendments.
I have append the FileSearch part of the macro program below
Will really appreciate if someone can help to fix it. Please try to be as simple as possible

Steps for FileSearch:

Code:
With Application.FileSearch 
    .NewSearch 
    If Section = "IL" Then 
        .LookIn = ILPath 
    Else 
        .LookIn = OLPath 
    End If 
    .SearchSubFolders = False 
    .FileType = msoFileTypeExcelWorkbooks 
    If .Execute > 0 Then 
        For iWB = 1 To .FoundFiles.Count 
            Set FoundWB = Workbooks.Open(Filename:=.FoundFiles(iWB), UpdateLinks:=0) 
            Set FoundWS = FoundWB.Sheets(1) 
            For iRow = 4 To FoundWS.Range("A65536").End(xlUp).Row 
                FoundTool = FoundWS.Cells(iRow, "M").Text 
                If FoundTool = vTool Then 
                    oleDate = Format(FoundWS.Cells(iRow, "A").Text, "dd/MMM/yyyy") 
                    iDate = Year(oleDate) * 10000 + Month(oleDate) * 100 + Day(oleDate) 
                    If iDate >= fDate And iDate <= tDate Then 
                        FoundWS.Rows(iRow).Interior.ColorIndex = 36 
                        FoundWS.Rows(iRow).Copy Destination:=YldWS.Rows(YldWS.Range("A65536").End(xlUp).Row + 1) 
                    End If 
                End If 
            Next iRow 
            FoundWB.Close SaveChanges:=False 
        Next iWB 
    End If 
End With

Thanks
Freddie

Last edited by macropod; 12-27-2013 at 07:30 PM. Reason: Added code tags & formatting
Reply With Quote