Option Explicit
' API...
Private Declare PtrSafe Function apiFindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As Any, _
ByVal lpWindowName As String) As LongPtr
Private Declare PtrSafe Function apiSetWindowForeground Lib "user32" _
Alias "SetForegroundWindow" (ByVal hwnd As LongPtr) As Long
Private Sub Workbook_Open()
Dim h As LongPtr
' Errors...
On Error Resume Next
' Activate...
h = apiFindWindow(0&, ThisWorkbook.Name & " - Excel")
' Debug...
Debug.Print h
' Check...
If h <> 0 Then
apiSetWindowForeground h
End If
End Sub