The attached 'Private Sub Worksheet_Activate' code is in my 'Combined' worksheet object in wb2. It works fine if i open that worksheet outside vba. However, it doesn't work when I open the workbook (wb1) & then activate that worksheet (Combined) from another wb2.
Wb2 does 2 things around it: (a) makes 'Combined' visible, and (b) activates the 'Combined' worksheet < this works fine.
Just in case it helps, I have posted the bit of code you might want to see where I maximise wb1 & activate 'Combined' worksheet.
Any recommendations please?
Application.ScreenUpdating = True
' The following code maximises the minimised AMT workbook and also activates 'Combined' worksheet
ActiveWindow.WindowState = xlMaximized
Private Sub Worksheet_Activate()
Dim cmbBar As CommandBar
Dim cmbControl As CommandBarControl
Set cmbBar = Application.CommandBars("Worksheet Menu Bar")
Set cmbControl = cmbBar.Controls.Add(Type:=msoControlPopup, temporary:=True) 'adds a menu item to the Menu Bar
.Caption = "&AMT Service Request" 'names the menu item
With .Controls.Add(Type:=msoControlButton) 'adds a dropdown button to the menu item
.Caption = "AMT Input Form" 'adds a description to the menu item
.OnAction = "F_OpenAMTInputForm"
.FaceId = 593 'assigns an icon to the dropdown