on 07-23-2014 2:56 PM
Hello,
in a vbs script I want the date to be entered:
DatumAnfang = Inputbox("Datum der Abfrage (TT/MM/JJJJ)?")
It works perfect with one little problem: even when the inputbos appears it's not active. I have to click into the box and after that I can enter the date.
How do I make the box active, so I can enter the date without using the mouse?
Best regards,
Lutz
Hello Stefan,
I didn't try it yet, but you tell me the reason for using two scripts?
And what is this line doing :
CreateObject("Wscript.Shell").Run "wscript.exe " & sExternalAppactivateVbs
Thanks,
Lutz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Lutz,
sorry for my late reply - vacation.
The line
CreateObject("Wscript.Shell").Run "wscript.exe " & sExternalAppactivateVbs
starts another instance of Windows Scripting Host and executes a script independently from the running script.
And I think this is the reason for this way, the independent setting of the window in the foreground. On this way you activate your window definitely.
Cheers
Stefan
Hello Lutz,
you can find an answer to your question here.
Here the solution from Torgeir Bakken:
<Snip>
First script to open the input box:
sExternalAppactivateVbs = "AppactivateInputBox.vbs"
CreateObject("Wscript.Shell").Run "wscript.exe " & sExternalAppactivateVbs
InputBox "nom", "My unique title"
Second script AppactivateInputBox.vbs:
Set oShell = CreateObject("Wscript.Shell")
Do
WScript.Sleep 200
i = i + 1
If i = 25 Then Exit Do
Loop Until oShell.Appactivate("My unique title")
<Snap>
Let us know the result.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.