Print all .xls files in selected directory

L

LB79

Does anyone know of a way that i can create a macro that prints all .xl
files in a particular diretory?

Thank
 
J

Jim May

Try:

Sub PrintAllinFolder()
Dim i As Long
Dim WB As Workbook
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = "C:\My Documents\MyFolderName"
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Workbooks.Open(.FoundFiles(i))
WB.PrintOut
WB.Close SaveChanges:=False
Next i
End If
End With
Application.ScreenUpdating = True
End Sub


Feedback appreciated...
I use Excel - XP
Jim May
 
Top