Private Sub cmdSelectFile_Click()
Dim vFile As Variant
vFile = Application.GetOpenFilename("Arbeitsmappe (*.xls), *.xls")
If vFile = False Then Exit Sub
Workbooks.Open vFile
SetForegroundWindow GetHandle
End Sub
Private Declare Function FindWindow Lib "user32.dll" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" _
(ByVal hwnd As Long) As Long
Function GetHandle() As Long
Dim sFormClassName As String
If Application.Version < 9 Then
sFormClassName = "ThunderXFrame"
Else
sFormClassName = "ThunderDFrame"
End If
GetHandle = FindWindow(sFormClassName, Me.Caption)
End Function