Bendo
10-25-2010, 09:01 PM
Hi all,
I have several spreadsheets with macros. There will be many more.
I need to have a master spreadsheet that calls a slave sheet in a different workbook and runs a macro in that sheet, then returns to the master spreadsheet and then continues in the master sheet macro to the second slave sheet in a second workbook and run a macro and return to master macro and run next line, etc. etc.
The problem is that I can call to another sheet but once the sheet is finished it does not return to the master or it returns to the master but starts at the top of the master macro again. Looping forever.
How to continue where it left off with the master macro after returning to it from another macro?
Below is what I have. I must be missing something. Any cluesticks appreciated. Everything stops after the first macro.
Sub Master000()
Application.WindowState = xlMinimized
ChDir _
"D:\Data\001"
Application.Run "'D:\Data\001\go-001a.xls'!slave"
ChDir _
"D:\Data\002"
Application.Run "'D:\Data\002\go-002a.xls'!slave"
ChDir _
"D:\Data\003"
Application.Run "'D:\Data\003\go-003a.xls'!slave"
End Sub
I have several spreadsheets with macros. There will be many more.
I need to have a master spreadsheet that calls a slave sheet in a different workbook and runs a macro in that sheet, then returns to the master spreadsheet and then continues in the master sheet macro to the second slave sheet in a second workbook and run a macro and return to master macro and run next line, etc. etc.
The problem is that I can call to another sheet but once the sheet is finished it does not return to the master or it returns to the master but starts at the top of the master macro again. Looping forever.
How to continue where it left off with the master macro after returning to it from another macro?
Below is what I have. I must be missing something. Any cluesticks appreciated. Everything stops after the first macro.
Sub Master000()
Application.WindowState = xlMinimized
ChDir _
"D:\Data\001"
Application.Run "'D:\Data\001\go-001a.xls'!slave"
ChDir _
"D:\Data\002"
Application.Run "'D:\Data\002\go-002a.xls'!slave"
ChDir _
"D:\Data\003"
Application.Run "'D:\Data\003\go-003a.xls'!slave"
End Sub