View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Jenga Linden Jenga Linden is offline
external usenet poster
 
Posts: 1
Default Count all "xlsx" fromat files in a Folder

Hi Bob-

I have a similar problem, except my Excel 2003 macro used to loop
through files in a folder and run a macro on them (like an update file
macro or something). Now I cannot run that and I have been trying
extremely hard to figure a way around it but I'm completely
lost...here's my old code, any help from anyone please would help :)

Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook

With Application.FileSearch
.NewSearch
'Insert path to folder with files to update below
.LookIn = "C:\Documents and Settings\Jennifer
Sturgill\Desktop\ERCI-JS Offline\JUNE VPM MACRO Defender
Files\TESTFILES"
.FileType = msoFileTypeExcelWorkbooks
'.Filename = "Book*.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(Filename:=.FoundFiles(lCount), UpdateLinks:=0)
Application.Run "PERSONAL.xls!VPM_BudgetUpdates2"
Next lCount
End If
End With

On Error GoTo 0


THANKS! J


*** Sent via Developersdex http://www.developersdex.com ***