Command line switch -enterkey

Frankschn

New member
Hi,

i try to use a ribbon to enter a new activation key and replace the existing one.
Code:
Sub newkey(control As IRibbonControl)
Dim RetVal
RetVal = Shell(PathToFile("myapp.exe  -enterkey"), 2)
Application.Quit
AppActivate ThisWorkbook.Windows(1).Caption
End Sub
my problem is the focus.
i want to close myapp and have the focus on the register program.
is this possible?
Thanks.
 
Hi,

the registration process opens in the background, because of the 2 ( vbMinimizedFocus).
with vbNormalFocus (1) the registration process opens in front of my messagebox to close myapp.
 
Last edited:
i want to close/save (own routine with msgbox) myapp.exe before the registration process begins. Otherwise it may happen that the application is opened twice
 
but i want to close the workbook first. or can I prevent with the command line that myapp after the registration starts?
 
my solution.
Code:
Public withoutcancel As Boolean
Sub register(control As IRibbonControl)
withoutcancel = True
Application.Quit
AppActivate ThisWorkbook.Windows(1).Caption
End Sub
… Workbook_BeforeClose(Cancel As Boolean)
Code:
ElseIf withoutcancel = True Then
ReturnValue = MsgBox("close application and register in the new window. save data?", vbYesNo + vbQuestion, "myapp")
Select Case ReturnValue
Case vbYes
ActiveWorkbook.Save
Case vbNo
End Select
ThisWorkbook.Saved = True
Dim RetVal
RetVal = Shell(PathToFile("myapp.exe  -enterkey"), 1)
Else
 
Last edited:
Back
Top