Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ensure correct user is logged on when running the macro
I am a new user and this is my 1st post. I have a VB program that runs around the clock and wakes up around 11:30 PM every night to update a spreadsheet with bank information. As part of this app I utilize QM macros. It runs great except when my wife stays logged onto her account or she leaves it at the logon screen. You indicated you could help me modify a macro to ensure my ID can get logged onto to run the app. Thanks in advance for your help.

Copy      Help
---- Recorded 2/17/2014 11:57:37 AM ----
int w2=act(win("Chase Online - Logon - Windows Internet Explorer" "IEFrame"))
lef 766 231 w2 1 ;;Internet Explorer_Server '', editable text 'User ID Attention Window Ey...'
'"userid@"   ;; "userid@" Backspace
lef 753 245 w2 1 ;;Internet Explorer_Server '', editable text 'Password'
'"bat" password"  ;; "bat" Backspace "password"
lef 755 304 w2 1 ;;Internet Explorer_Server '', push button 'Log On'
wait 30 WT w2 "Chase Private Client - My Accounts - Windows Internet Explorer"
wait 1.0
rig 1528 301 w2 1 ;;Internet Explorer_Server '', pane 'Chase Private Client - My A...'
lef 81 275 wait(56 WV win("" "#32768")) 1 ;;menu item 'View Source'
men 2139 win("" "DocHostUIHandler Popup Tracker") ;;
int w3=wait(6 win(" - Original Source" "HTMLSOURCEVIEW"))
wait 1.0
lef 11 -10 w3 1 ;;menu item 'File'
lef 43 8 wait(7 WV win("" "#32768")) 1 ;;menu item 'HTML Source...[9]Ctrl+S'
men 5111 w3 ;;HTML Source...
int w4=wait(6 win("Save As" "#32770"))
'"Chase"        ;; "Chase"
lef 39 11 wait(5 WV win("" "Auto-Suggest Dropdown")) 1 ;;list, list item 'Chase.htm'
lef 465 449 w4 1 ;;push button 'Save'


main_function  Macro26
exe_file  C:\LogonChase.exe
icon  <default>
manifest  $qm$\default.exe.manifest
flags  6
guid  {556A347B-3FC7-4B52-AB49-2B579671ADBD}
In the Properties dialog of the macro, configure it to unlock computer. Also click the How button and make changes in the Unlock Computer Options dialog. Test how it works.

However it handles only the case when computer is locked, in the switch-user or logon screen. If logged in another account, will be more complicated. If unlocking works for you, I can try to create code that switches user, but not sure it is possible.
I checked If computer locked, temporarily unlock which automatically also checked Don't run as background user. I then clicked on How, but I'm not sure what to do next. After a switch user, the screen just shows the 2 user Icons. I don't have a password and I just want the equivalent of clicking on the user ICon Greg. How do I do it?
In the text box below Send Keys replace text to QM keys that you would press in the switch-user screen.
If your user picture is focused, need only Enter or Space.
If another picture is focused, also need Left Arrow.
Try this:

If some other control focused, keys probably will not work.

Also uncheck 'Wait...' in the right side.
I tried both space and LV in text box and got this error message. Warning: LogonChase cannot run on non-interactive desktop. What did I do wrong?
And QM did not unlock computer? (In the switch-user screen computer is locked).
What keys you wold press to unlock computer while it is in the switch-user screen?
If don't know, try to unlock with Space, Tab, arrows.
To unlock manually, I use right arrow and space. When I try to enter the right arrow key under the Send keys box, it doesn't seem to take it (the cursor does not go over 1 character like if I entered another key). Is there another designation for right arrow to be placed into the keys to send instead?
right arrow and space in QM is:
I tried that, but it made no difference. The screen stays with the 2 user logon ICONS, but nothing happens. Then when I do logon to my userid, the app has crashed because the file it should have created does not exist. I should note that the macro's exe is called from a VB program, it is not just a standalone macro, if that makes any difference. I put in a 30 second delay in the VB program to allow me enough time to do a Switch User so that I'm at the screen of the 2 user logon ICONS when the timer pops.
Quote:the macro's exe
The macro must run from Quick Macros. Nothing will unlock computer if it is exe file executed from Excel. In Properties dialog create command line to run the QM macro, and let the Excel macro execute it.

To test unlocking computer easily, create this macro and run it directly from QM, eg click the Run button:
Copy      Help
shutdown 6 ;;lock computer
if(!EnsureLoggedOn(1)) end "failed to unlock computer"
That worked, thanks again for your help.

Forum Jump:

Users browsing this thread: 1 Guest(s)