I have a project that keeps growing and growing and growing. I'm at the last bit and it isn't looping. I'm not seeing why. I have the elements in their own macros and they perfectly until I try to combine them into a super macro that runs them all. The idea is that the "master" workbook (XLSM) will run its own update, THEN Open all other XLSM files in the same folder and run THEIR Updates which pushes data to other XLSX files. Right now each XLSM file runs a macro that works perfectly by Sub EndofDay () Call step 1 Call Step 2 End Sub I used the same "Do while" structure for the SuperMacro that opens the other books and calls their "EndofDay". it gets through a couple of the XLSM files then stops with an error on MyFiles = Dir. the following syntax SHOULD run the masters updates and one other code string, THEN open all other XLSM files in the Folder. Why does it suddenly not work at this level when It works on the level under this.
Sub SuperMacroEOD_Trans()
Dim MyFiles As String
Call EndofDayTransfer 'Do this Workbook Transfer first then:
'Step 2: Specify a target folder/directory.
MyFiles = Dir("C:\Users\ME\Desktop\QA VBA Project\*.xlsm")
'Dont try to open this workbook and do anything.
Do While MyFiles <> "" And MyFiles <> "C:\Users\ME\Desktop\QA VBA Project\Update_Master.xlsm"
'Step 3: Open Workbooks one by one
Workbooks.Open "C:\Users\ME\Desktop\QA VBA Project\" & MyFiles
Call EndofDayTransfer 'Call same macro you ran and run in the other workbooks (they contain it).
ActiveWorkbook.Close SaveChanges:=True
'Step 4: Next File in the folder/Directory
Loop
MyFiles = Dir <------------Gets stuck here or editor turns it yellow.
End Sub