How to get Excel window to foreground to send key strokes?

Hello experts!
I am using send keys activity to save excel file from SAP.
I need to do RDP to access SAP and download excel file.
When I open RDP screen and use send keys activity to save excel file it works perfectly But real problem arises when I close the RDP screen, send key activity is not working .

What’s may be the problem ?

Hi @Prabin_Chand,

Are you downloading files from RDP to your machine?
of course, send key won’t work if RDP screen is closed.
What actions are causing to close the RDP screen?

Hi @Prabin_Chand
Send hotkey does not work on the background; it needs the window and should be visible. In order to change the process to the foreground, use click activity to save a file.

Hi @Prabin_Chand, are you using the SAP in RDP,
If yes means you want to keep RPA screen open to download the SAP file.

All the files are downloaded in RDP server.
My machine is just for doing RDP

Opening RDP screen or closing it doen’t matters.
My aim is to save the excel file in RDP server using send keys.

I did used attach window , get active window activities but all fails to work.

Hi @Aakash_Singh_Rawat ,
The screen used to be closed by default.
Current I am developing my automation in developer server using RDP.
And I need to publish it to production sever in future which is a virtual Server . which is screen closed by default as we cannot see virtual server until and unless we do RDP.

When i do RDP and see Screen is open send keys works fine, but when i close the RDP server it is not working!

Hi @Prabin_Chand , Try this steps

  1. Make sure that shortcut keys are working manually or not
  2. Don’t indicate anything in Send Hotkey and try again

Have you installed the UiPathRemoteRuntime in RDP server ?

Hi @rohin_Kumar ,
I have already tried step 1 and it’s working perfectly

Not sure if i have installed UiPathRemoteRuntime

Hi @Prabin_Chand, Try to indicate some desktop shortcuts logo, if it is indicate means no problem or else you need to install it to automate the RDP server

Hi @rohin_Kumar ,
yes, it is indicating the logos in desktop as i have already installed UiPath in my developer server

Fine, Finally try this on the SAP screen before using send hotkey
2.Don’t indicate anything in Send Hotkey and try again

Hi @rohin_Kumar ,
Send keys is perfectly working fine.
when when i close the rdp send key is not working.

Error is showing!

You are using the SAP in RDP sever, You want to download the excel file in RDP server using send hotkey, so why are you closing RDP, If you closing the rdp means send hotkey will not work at background

Which system are you using Attended or Unattended
Attended means u have one more step to do

Thanks everyone for your time to reply.
I am much familiar with vbscript so i code in vbs to save excel file which solved my problem

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.