Hi
I've been trying to write VBA code to switch to the next market once certain conditions within the currently open market are satisfied. The conditions are based on cells G1, C3, F3, and F4 (the time and In-play cells). Using "AppActivate" and "SendKeys" I've been able to switch focus to Bet Angel and send the keystroke "Control N" to change to the next market. The problem is that when the focus goes back to Excel the worksheet has frozen and those cells have not updated and so trigger the macro again. When the focus next returns to Excel the sheet updates fine, but is now one market ahead of where I want it to be. I tried adding a line to send the keystroke "Control P" but that still leaves me in the wrong market. I've tried using "Application.EnableEvents" without success (though I may be using it in the wrong place).
Has anyone had any success doing something like this or have any ideas?
Thanks in advance
Using VBA to change market
Hi,
I have not tried exactly this, but it could be that your code is switching back to Excel too quickly, maybe putting in a delay would let BetANgel get finished updating itself, and then when you switched back to Excel it would be displaying the correct race. Nic
I have not tried exactly this, but it could be that your code is switching back to Excel too quickly, maybe putting in a delay would let BetANgel get finished updating itself, and then when you switched back to Excel it would be displaying the correct race. Nic