hi,
yes, you can do this.
in a Blank workbook create macro and add code like this:
sub mastermacro() ' or whatever
Workbooks.Open Filename:="c:\temp\A1.xls"
call mac1
activeworkbook.save
activeworkbook.close
Workbooks.Open Filename:="c:\temp\A2.xls"
call mac2
activeworkbook.save
activeworkbook.close
Workbooks.Open Filename:="c:\temp\A3.xls"
call mac3
activeworkbook.save
activeworkbook.close
I do something similar each morning except i do 10
files/macros.
once started the macro must go to end.
you cannot open file a1 and start macro mac1 then try to
close the mastermacro file. crash and burn.
for that reason it might be a good idea to copy all the
macros to the mastermacro file. that is how i do my
morning thing above. all the code is in one file.
-----Original Message-----
Hi,
I have 3 very big Excel files and in each one of them
there is a macro writing in VB.
The files and there macro names:
File name Macro name
A1 ------------ Mac1
A2 ------------ Mac2
A3 ------------ Mac3
Because the files are very big I am:
1. Opening one file at a time
2. Activate his macro
3. Save, close and open the next one and so on
My question:
From a different Excel file, can I activate the macro in
each one of the files (A1-A3)?
Meaning:
From a file call "Control"
The macro in this file will be:
- Open file A1
- Activate macro Mac1
- When finish, save and close the file
- Continue the same with files A2 and A3
How can I do that?
What will be the VB commands for the macro in
the "Control" file?
Thank you very much in advance,
Haim.
.