PDA

View Full Version : Switching Between Two Already Open Apps



zunebuggy
05-22-2023, 10:10 AM
I have an Excel sheet open with a macro, another application and notepad.

I used to be able to copy from the one app (SendKeys "^C") and then switch focus to Notepad and then Paste (SendKeys "^V") the text and switch back to the application, repeat, etc. I think I used to do this with AppActivate but this seems to open a new instance of Notepad each time and also open a new instance of the application. I used to use this method and automate a time consuming task I only do once a year. I found examples online but they all open new instances on every copy/paste. I just need to switch between the two already open apps. Did Microsoft change things or am I forgetting how to do this?

I know SendKeys is not the best way to do this, but it is an older in-house application and screen grab is the best way for this copy/paste task.

Thank you.

Jan Karel Pieterse
05-23-2023, 08:18 AM
It might be helpful if you show us your code :-)

michaelrosa
05-26-2023, 02:12 AM
It might be helpful if you show us your code :-)
Yes, I also think that you should provide code to get more exact suggestions.
shell shockers 2 (https://shellshockers2.com)

Logit
05-28-2023, 04:07 PM
Pressing ALT / TAB at the same time will take you from one program to another.