Right, but the remainder of the code in file2 depends on file1 being closed (file2 moves file1, then saves itself to file1's old location and name).
The crummy hack I just came up with does this:
Right before this command:
Workbooks("1.xls").Close savechanges:=False
I've added...
By all means, Brainstorm!
It's a good idea. I've tried both workbook_activate and having it just in a standard module in file2 and having file1 either activate file2 or run file2's macro in the module, but both have the same effect: file2's macro runs first before file1's can finish, file2...
OK, so as it stands I have 2 files; 1.xls and 2.xls.
file1 has a macro:
Sub One()
Workbooks.Open Filename:="c:/2.xls"
MsgBox "You'll never see this message "
End Sub
and file2 has this in its ThisWorkbook:
Private Sub Workbook_Open()
Workbooks("1.xls").Close...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.