Hi Everyone, Sometimes while doing some VBA stuff, we want to target Sendkeys to a particular window which may or may not be active or present. Here is the code which will first check if the Target window is available by trying to activate it by AppActivate and then Sendkeys as desired. If Target window isn't available then you may wait until it shows up or show an error message. So Here are the code:- 1. For waiting until Windows shows up:- Sub Target_Sendkeys() On Error Resume Next 'Resuming next Statement on Error(5) Do Err.Clear 'Reseting the Err AppActivate "Blogger" 'Put the name of title bar of Target window here. DoEvents 'Avoidings hangs Loop While Err.Number = 5 SendKeys "%{ }r", True 'Restoring the window Application.Wait DateAdd("s", 1, Now) '...
Custom Excel Solutions.. ( Excel Functions and Vba )