Good morning,
I have an opening vba that checks if a program is open and if not it will open it for me:
The program is minimized upon opening and it then waits 5 seconds (as you can see in the code above) before the next macro is automatically run which calculates few things and shows me the result in a msgbox.
The problem is the msgbox is hidden UNTIL I physically CLICK onto the excel window/program.
I have tried:
Windows("ThisExcel.xlsm").Activate
ThisWorkbook.Activate
BUT nothing seems to actually refocus back onto the excel program so its back up on top of all my other programs and then show me the msgbox with the important results.
I have also tried modal msgbox alert
MsgBox "Value of your input is XXXX", vbSystemModal, "IMPORTANT"
and that still doesn't come forward to the top.
Any suggestions?
I need the msgbox to pop out infront of EVERYTHING.
Thank you
I have an opening vba that checks if a program is open and if not it will open it for me:
Code:
Sub CheckProg()
Dim objList As Object, objType As Object, strObj$
strObj = "terminal.exe"
Set objType = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='" & strObj & "'")
If objType.Count = 0 Then
Dim x As Variant
Dim Path As String
Path = "C:\Program Files (x86)\Oolah41\terminal.exe"
x = Shell(Path, vbMinimizedFocus)
Application.Wait (Now + TimeValue("0:00:05"))
End If
End Sub
The program is minimized upon opening and it then waits 5 seconds (as you can see in the code above) before the next macro is automatically run which calculates few things and shows me the result in a msgbox.
The problem is the msgbox is hidden UNTIL I physically CLICK onto the excel window/program.
I have tried:
Windows("ThisExcel.xlsm").Activate
ThisWorkbook.Activate
BUT nothing seems to actually refocus back onto the excel program so its back up on top of all my other programs and then show me the msgbox with the important results.
I have also tried modal msgbox alert
MsgBox "Value of your input is XXXX", vbSystemModal, "IMPORTANT"
and that still doesn't come forward to the top.
Any suggestions?
I need the msgbox to pop out infront of EVERYTHING.
Thank you
Last edited: