Please assist, I don`t know what i did wrong here.
Sub AllWorkbooksMacro()
GoodStart
'CopyFilesArcs
'Sub AllWorkbooksMacro()
Dim myPath As String
Dim myFile As String
Dim wbk As Workbook
Dim oFSO As Object
Dim oFile As Object
Dim oFiles As Object
Dim oFolder As Object
myPath = "C:\Users\Theyman\Documents\Advance On Point Solutions\Progress Reports\2022\7.July\Arcs"
If Right(myPath, 1) <> "\" Then myPath = myPath & "\"
myFile = Dir(myPath & "*Advance*.xlsm", vbNormal)
If Len(myFile) = 0 Then
MsgBox "Nothing found...", vbExclamation
Exit Sub
End If
Do While Len(myFile) > 0
Set wbk = Workbooks.Open(FileName:=myPath & myFile)
Set Awbk = ActiveWorkbook
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(myPath) 'You must initialize this before
Set oFiles = oFolder.Files
'For all files in the folder
For Each oFile In oFiles
If (oFile Like "*.xls*") Then
Set Awbk = Workbooks.Open(FileName:=oFile)
DoEvents
'Call ReCaptureEntireMonth(Awbk)
Application.Run "'" & myPath & myFile & "'!ReCaptureEntireMonthLIsle"
Awbk.Close SaveChanges:=True
DoEvents
End If
Next
Loop
End Sub
Sub AllWorkbooksMacro()
GoodStart
'CopyFilesArcs
'Sub AllWorkbooksMacro()
Dim myPath As String
Dim myFile As String
Dim wbk As Workbook
Dim oFSO As Object
Dim oFile As Object
Dim oFiles As Object
Dim oFolder As Object
myPath = "C:\Users\Theyman\Documents\Advance On Point Solutions\Progress Reports\2022\7.July\Arcs"
If Right(myPath, 1) <> "\" Then myPath = myPath & "\"
myFile = Dir(myPath & "*Advance*.xlsm", vbNormal)
If Len(myFile) = 0 Then
MsgBox "Nothing found...", vbExclamation
Exit Sub
End If
Do While Len(myFile) > 0
Set wbk = Workbooks.Open(FileName:=myPath & myFile)
Set Awbk = ActiveWorkbook
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(myPath) 'You must initialize this before
Set oFiles = oFolder.Files
'For all files in the folder
For Each oFile In oFiles
If (oFile Like "*.xls*") Then
Set Awbk = Workbooks.Open(FileName:=oFile)
DoEvents
'Call ReCaptureEntireMonth(Awbk)
Application.Run "'" & myPath & myFile & "'!ReCaptureEntireMonthLIsle"
Awbk.Close SaveChanges:=True
DoEvents
End If
Next
Loop
End Sub