Windows 10 blocks send keystrokes?

Discuss RoboTask here
chris.james
Posts: 11
Joined: Fri Oct 26, 2018 9:45 pm

Windows 10 blocks send keystrokes?

Post by chris.james »

I've had Robotask for a couple months now and I really like it. But I've just moved to a Windows 10 from a Windows 7 PC and the "send keystrokes" part of my tasks do not work anymore when my PC is locked?
Anyone else had this issue and how can I fix it? Thanks!
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Windows 10 blocks send keystrokes?

Post by Oleg »

But I've just moved to a Windows 10 from a Windows 7 PC and the "send keystrokes" part of my tasks do not work anymore when my PC is locked?
I can say that Send keystrokes and mouse actions doesn't work when PC is locked on Windows 7 too.
System ignores mouse and keyboard simulation within locked session. This is the property of system security
Oleg Yershov
chris.james
Posts: 11
Joined: Fri Oct 26, 2018 9:45 pm

Re: Windows 10 blocks send keystrokes?

Post by chris.james »

It worked fine on my Windows 7 system, but maybe I had something enabled or disabled on it that allowed it to work? Any suggestions of how I can get around this?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Windows 10 blocks send keystrokes?

Post by Oleg »

maybe the session was not locked
System ignores keyboard simulation on Windows 7 when session is locked. This is exact information.
Press Win+L to lock the session and try the task on Windows 7
Oleg Yershov
chris.james
Posts: 11
Joined: Fri Oct 26, 2018 9:45 pm

Re: Windows 10 blocks send keystrokes?

Post by chris.james »

OK thanks. I have decided to go a different route and I built a macro to save and close the workbook. I have added the Excel run macro action and then I log off to see if it will work, but I keep getting an error message that says "Excel object doesn't exists. Open Document first" but the document is open. I set this action up just like the instructions on your website says.
chris.james
Posts: 11
Joined: Fri Oct 26, 2018 9:45 pm

Re: Windows 10 blocks send keystrokes?

Post by chris.james »

I finally got this working by using the regular "Open Excel document" action first instead of the command line open. It works perfectly now even when my PC is locked! Thank you for the awesome software!
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Windows 10 blocks send keystrokes?

Post by Oleg »

...but I keep getting an error message that says "Excel object doesn't exists. Open Document first" but the document is open...
I finally got this working by using the regular "Open Excel document" action first instead of the command line open.
Yes of course. You have to use Open Excel document action before you use any other Excel actions
Oleg Yershov
chris.james
Posts: 11
Joined: Fri Oct 26, 2018 9:45 pm

Re: Windows 10 blocks send keystrokes?

Post by chris.james »

Ok, I thought it was working properly, however it is only partially working.
The task opens the excel spreadsheet and after my "pause" commands, it saves, closes and emails the spreadsheet as it should. However, nothing actually updates while the PC is locked. Macros and VBA code doesn't run and neither does data automatically refresh as it does when the PC is unlocked. Is there anyway to allow these macros and VBA code and auto data refresh to work while PC is locked?
I've cut off macro security within Excel and made sure it is located in a trusted location, but it still will not update properly.
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Windows 10 blocks send keystrokes?

Post by Oleg »

Unfortunately I can say nothing without your task... Also I want to see the Excel document with your macros
Excel actions should work in locked session.
Oleg Yershov
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Windows 10 blocks send keystrokes?

Post by Rukbunker »

Just my 2 cents on this topic. Maybe it gives you some ideas.

We have about 30 tasks which all do practically the same. Opening Excel, execute a macro, wait for a pixel, and closes the file. In our case we don't use the "Excel" features in Robotask. We just do a application opening the file.
Robo1.PNG
Robo1.PNG (19.13 KiB) Viewed 32068 times
Our macro in Excel has a shortcut key assigned, in our case Control+M. This is only of the few shortcuts which is normally not used in Excel. Step 6 (see screenshot) wait until a certain pixel is there and therefore the document is loaded. Step 7 triggers the shortcut-key to execute the macro. At the end of the macro, a file in %Appdata% will be generated. Robotask wait until that file appears (Step 8).

Code: Select all

Sub Check_File()
'
' Check_File Macro
'
    
  Dim fileName As String, textData As String, textRow As String, fileNo As Integer
    fileName = Environ("AppData") & "\ExcelMacroFinished.txt"
    fileNo = FreeFile 'Get first free file number
    textData = ""
    Open fileName For Output As #fileNo
    Write #fileNo, textData
    Close #fileNo
'
End Sub
At the end an Alt+F4 and the work is done. It works great.
Post Reply