I have been working on a code to open all files in a folder and run each of their macro, save&close each of them. I have a "Master" file that I am putting it in.
I am getting a sub or fx not defined on my sub routine
part of the code.
The full code is:
Help would be awesome, thanks.
I am getting a sub or fx not defined on my sub routine
Code:
Call UpdateData
The full code is:
Code:
Sub UpdateAll() Dim folderPath As String
Dim filename As String
Dim wb As Workbook
folderPath = "K:\Location\"
If Right(folderPath, 1) <> "\" Then folderPath = folderPath + "\"
filename = Dir(folderPath & "*.xls")
Do While filename <> ""
Application.ScreenUpdating = False
Set wb = Workbooks.Open(folderPath & filename)
Call UpdateData
wb.Close SaveChanges:=True
filename = Dir
Loop
Application.ScreenUpdating = True
End Sub
Help would be awesome, thanks.