Excel im Vordergrund
04.01.2017 21:26:02
Thomas
ich habe eine Excel Datei, wo nur die Userform aufgeht.
Code:
Option Explicit
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Visible = True
End Sub
Private Sub Workbook_Open()
Application.Visible = False
Application.WindowState = xlNormal
UserForm1.Show
End Sub
Ich öffne diese über eine vbs Datei, somit brauch man keine Inhalte aktivieren.Leider öffnet sich das Fenster (userform) im Hintergrund, bzw. hinter anderen Fenstern.
Wie bekomme ich das hin, das es im Vordergrund öffnet?
Hier mal die vbs Datei:
Option Explicit
Dim Excel, FSO, Path
Set Excel = WScript.CreateObject("Excel.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
Path = FSO.GetParentFolderName(WScript.ScriptFullName)
Excel.Visible = True
Excel.Workbooks.Open Path & "\Muster_Oelblatt_2.1.xltm", , , , ""
Set Excel = Nothing
Set FSO = Nothing
WScript.Quit