I need to print the first worksheet of every workbook on a network drive. I have gotten this far.
Private Sub PrintFiles()
Dim i As Long
Dim WB As Workbook
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = "P:\MiniMonthlies\fairpoint"
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Workbooks.Open(.FoundFiles(i))
WB.PrintOut Copies:=2
WB.Close False
Next i
End If
End With
Application.ScreenUpdating = True
End Sub
I can not figure out how to make it print just the first sheet, plus all the workbooks ask if you would like to update or not since they have external links. How can I set it to update all of them? Any help would be greatly appreciated.
Thanks,
Wray
Private Sub PrintFiles()
Dim i As Long
Dim WB As Workbook
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = "P:\MiniMonthlies\fairpoint"
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Workbooks.Open(.FoundFiles(i))
WB.PrintOut Copies:=2
WB.Close False
Next i
End If
End With
Application.ScreenUpdating = True
End Sub
I can not figure out how to make it print just the first sheet, plus all the workbooks ask if you would like to update or not since they have external links. How can I set it to update all of them? Any help would be greatly appreciated.
Thanks,
Wray