Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-26-2013, 07:20 PM
fredang fredang is offline Urgent help needed for 2003 Macro to run in Excel 2007 Windows 7 64bit Urgent help needed for 2003 Macro to run in Excel 2007 Office 2007
Novice
Urgent help needed for 2003 Macro to run in Excel 2007
 
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
  #2  
Old 12-27-2013, 07:34 PM
macropod's Avatar
macropod macropod is offline Urgent help needed for 2003 Macro to run in Excel 2007 Windows 7 32bit Urgent help needed for 2003 Macro to run in Excel 2007 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Application.Filesearch is not supported in office 2007 & later. Andreas Killer has made a replacement class module you can download from:
http://dl.dropbox.com/u/35239054/FileSearch.cls
For a discussion of how to use the class module, see: http://answers.microsoft.com/en-us/o...8-84f28300dba4
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
2003 to 2007 excel, 2003 to 2007 vba, filesearch

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT VBA needed for placing image on page AndyDDUK PowerPoint 2 11-12-2012 09:54 AM
Urgent help needed for 2003 Macro to run in Excel 2007 Urgent help needed sinrockz Office 3 08-19-2011 10:58 AM
Urgent help needed for 2003 Macro to run in Excel 2007 Corrupt word doc! URGENT HELP NEEDED!! 99nasha Word 1 03-11-2011 04:24 PM
Help-urgent help needed immediately munstershug PowerPoint 1 05-01-2010 11:27 AM
MS-Word 2003 Help Needed Urgent Karthik123 Word 10 01-26-2010 08:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft