I have a simple script trying to change to another tab on an excel spreadsheet and to do that requires a CTRL Page Up command. Below is my script and I can't get the CTRL to be recognized and pressed in teh macro.
Thanks for an education
execute file>todaysfile.xls
setfocus>Microsoft Excel - todaysfile.xls
wait>.2
press up * 50
wait>.2
press left * 50
wait>.2
press CTRL
wait>.2
press page up
wait>.2
release CTRL
wait>.2
press home
Excel does not recognize the CTRL Press
Moderators: JRL, Dorian (MJT support)
use vk keys here is a sample script mettmar gave me back in the day that i still use you will ned to go to site to get vkcode for ctrl but this works with all keypresses also you only need to change where it says VK_down=40 just have to change the 40 for each key you can use exact same snippet of code for each key your pressing just use whole snippet and change 40 and change wait for duration the wait is how long it holds down key before releasing it
Code: Select all
//Key codes at <a>http://www.mjtnet.com/vkcodes.htm</a>
Let>VK_DOWN=40
Let>ExtendedKey=1
Let>KeyUp=2
//Press Down Arrow
LibFunc>user32.dll,keybd_event,r,VK_DOWN,0,ExtendedKey,0
//Wait 10 seconds
Wait>10
//Now release Down Arrow
Let>FLAGS={%ExtendedKey% OR %KeyUp%}
LibFunc>user32.dll,keybd_event,r,VK_DOWN,0,FLAGS,0
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!
I'd suggest adding a WaitWindowOpen> line. As-is the script has run and completed before Excel has opened. Then I'd bump the first wait up a bit. After the script is working start shaving time off the different Waits being careful to not go so far as to cause intermittent failures.
Code: Select all
execute file>todaysfile.xls
WaitWindowOpen>Microsoft Excel - todaysfile.xls
setfocus>Microsoft Excel - todaysfile.xls
wait>3
press up * 50
wait>.2
press left * 50
wait>.2
press CTRL
wait>.2
press page up
wait>.2
release CTRL
wait>.2
press home