Hi, thanks for looking.
I have a routine defined as
Sub BaseFormat(wb as workbook)
.
I have written another module where I ask the user for the files path, and it will run this code on all the workbooks in the path.
So far it is only opening the first workbook in the directory and not running anything on the workbook, is there something wrong with this code or do i need to look into the BaseFormat module?
Thanks for your help
Option Explicit
Sub ProcessFiles()
Dim Filename As String
Dim Pathname As String
Dim wb As Workbook
Pathname = InputBox("Please input file(s) directory", "NEO Inc") & "\"
Filename = Dir(Pathname & "*.xls")
Do While Filename <> ""
Set wb = Workbooks.Open(Pathname & Filename)
BaseFormat wb
wb.Close SaveChanges:=True
Filename = Dir()
Loop
End Sub
Bookmarks