Hi Johnny,
Have you considered opening a ReadOnly copy of the Master
Book and shifting it behind the Slave Book? If it's
open, your button clicks won't need a path (See below).
The following may give you some ideas:
'SlaveBook.xls
'IN A SHEET OBJECT
Private Sub CommandButton1_Click()
Call OpenMaster
End Sub
Private Sub CommandButton2_Click()
'USE SOME VALID MasterBook.xls PROCEDURE HERE
Application.Run "MasterBook.xls!TstMasterSub"
'NO PATH REQUIRED HERE
End Sub
'SlaveBook.xls
'IN A MODULE
'CALL FROM A BUTTON CLICK, AUTO_OPEN, OR??
Sub OpenMaster()
Application.ScreenUpdating = False
Workbooks.Open _
Filename:="\\your\fixed\path\to\MasterBook.xls", _
ReadOnly:=True
ThisWorkbook.Activate
End Sub
'SlaveBook.xls
'IN THE WORKBOOK OBJECT
'DON'T LEAVE THE MASTERBOOK.XLS FILE OPEN ALONE
Private Sub Workbook_BeforeClose(Cancel As Boolean)
For Each wb In Workbooks
If wb.Name = "MasterBook.xls" Then _
wb.Close savechanges:=False
Next
End Sub
'MasterBook.xls
'IN THE WORKBOOK OBJECT
Private Sub Workbook_Open()
If Workbooks.Count = 1 Then
ThisWorkbook.Close savechanges:=False
Else
'TRIGGER ANY VALID AUTO_OPENS HERE
MsgBox "Master Book Opened"
End If
End Sub
Best Regards,
Walt Weber