![]() |
#1
|
|||
|
|||
![]()
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 |
#2
|
||||
|
||||
![]()
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] |
![]() |
Tags |
2003 to 2007 excel, 2003 to 2007 vba, filesearch |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
URGENT VBA needed for placing image on page | AndyDDUK | PowerPoint | 2 | 11-12-2012 09:54 AM |
![]() |
sinrockz | Office | 3 | 08-19-2011 10:58 AM |
![]() |
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 |