Works perfect, thanks ! and the otherway pageup x 4 ?
It still an uggly solutions but I'm so glad I finaly have access to it. This is opening a new world. If You for an example whant to automaticly fill in data in an external program You can do it by vba copy past... Its a bit tricky to find out where the external program is place on the screen but its doable....
Please be aware that using SendKeys to control programs is, across the development world, considered to be
very high-risk and therefore, not recommended.
I'm not trying to be critical of anyone in this thread (as I'll confess I've toyed around with SendKeys usage more than once over the years), but the best advice you'll get on it IMO is not to use it.
The reason is nothing other than the obvious that you already probably guessed: It's too uncertain what it's going to do, and might end up not only failing to do what you want it to do, but doing something else really harmful, or embarrassing ...
In all my time in the tech world, I have seen a single case where SendKeys was used regularly and actually worked correctly on a regular basis (although not 100%). A co-worker had set up a special Citrix desktop environment that was dedicated to this purpose. They would open two programs exclusively on that desktop: 1) the Excel workbook containing the sendkeys macro, 2) an AS400 Terminal screen, whose usage was exclusively centered around keystrokes and was
guaranteed to hold the focus and keep its window at the Fore. The keystrokes would disposition certain medical claims in a certain way - and in fact, its success was also dependent on return messages that the macro was able to detect from AS400 via an API set up for that specific purpose. It was a rather strange and rare scenario - and the only time I've ever seen it done to accomplish any half-way serious purpose, over the long term, successfully.
SendKeys is fun & interesting until it accidentally deletes a file, activates the wrong window (like a Chat message to your Boss) and presses Enter, ruins what you are doing on your primary screen, accidentally edits or adds something, etc.
You'll also run into a plethora of issues due to user-specific program configurations. For example, I've tried to use it to Tab a certain number of times on things like: 1) a Browser, 2) a PDF.......then realized that the # of times Tab was needed would be totally different depending on how users had configured their favorites, menu, tabs, and a host of other things.
Use with extreme caution and only after understanding the risk.