Hi hopefulhart,
See how this goes:
Option Explicit
'Written by Trebor76
'Visit my website www.excelguru.net.au
'Opens all files in the 'strFolderName' directory and then saves them on closing.
'http://www.excelforum.com/excel-programming-vba-macros/964198-macro-to-open-all-files-in-a-folder-save-them-then-close-them.html
Sub Macro1()
Dim strFolderName As String
Dim strFileName As String
Dim wrkMyWrkbook As Workbook
strFolderName = "C:\Temp\" 'Folder containing the files. Change to suit, but don't forget the trailing backslash '\'
strFileName = Dir(strFolderName & "*.xls*") 'Only open Excel related files.
Application.ScreenUpdating = False
Do Until strFileName = ""
Set wrkMyWrkbook = Workbooks.Open(strFolderName & strFileName)
wrkMyWrkbook.Close SaveChanges:=True
strFileName = Dir()
Loop
Application.ScreenUpdating = True
End Sub
Regards,
Robert
Bookmarks