Viewing the code might help somebody give an answer....
This is the AutoOpen from A.(VSU_Register)
Sub Auto_Open()
Application.ScreenUpdating = False
Application.OnSheetActivate = "TrapKey"
Sheets("VSU").Select
Application.Run "VSU_Register.xls!Max_Prepare"
End Sub
And here is B(NH_Register01)
Private Sub Auto_Open()
Application.ScreenUpdating = False
Application.OnSheetActivate = "TrapKey"
Sheets("VSU").Select
Application.Run "NH_Register01.xls!Max_Prepare"
End Sub
Is it possible that the macros are ? connected some way as the 2nd file only opens when I run a macro.
Cheers Tee.
Try looking at the links of both workbooks (Edit-Links). If there are any external links, then you may have found your problem...
Hope this helps!
Russell
Russell,
On looking at your code, here is what I believe is happening:
In your Auto_Open procedure in workbook named VSU_register.xls you have the line of code:
Application.Run "VSU_Register.xls!Max_Prepare"
Since you gave it an explicit file name, but no path, it goes to the default (working) directory to find it. If the instance of VSU_register.xls in this directory is not the same instance of the VSU_register.xls workbook that this code is running within (the one you opened), Excel has to open it as well. If you really wanted it always to look for the Max_Prepare macro within the workbook that you first open simply replace the Application.Run statement with:
Max_Prepare
which Excel will always look for within the active workbook.
Good luck!
Damon
Hi Tee,
I have seen this happen before, if I remember correctly you need to open one of the files (Both should Open), then close one and do a file SaveAs,and pick a new name. Repeat the process for the other file.
Jerid