Ich habe ein Makro gefunden, mit dem nur die Userform bei Start der Excel-Datei angeziegt wird.
Private Sub Workbook_Open()
Private Declare _
Function mlfhFindWindow _
Lib "user32" _
Alias "FindWindowA" (ByVal a As Any, _
ByVal b As String) As Long
Private Declare _
Function mlfhSetActiveWindow _
Lib "user32" _
Alias "SetActiveWindow" (ByVal n As Long) As Long
Private Sub Workbook_Open()
Dim b As Boolean
Dim s As Long
Dim h As Long
b = Application.ShowWindowsInTaskbar
s = Application.WindowState
Application.ShowWindowsInTaskbar = False
Application.WindowState = xlMinimized
h = mlfhFindWindow(0&, Application.Windows(1).Caption)
mlfhSetActiveWindow h
UserForm1.Show
Application.ShowWindowsInTaskbar = b
Application.WindowState = s
End Sub
Mein Problem ist jetzt, dass die Userform hinter dem Explorer Fenster verschwindet und auch in der Taskliste der Explorer aktiviert ist.
Gibt es einen Befehl, um das Excel Fenster zu aktivieren?
Danke für eure Hilfe!
Gruss
Waven