pblomfield Posted April 14, 2010 Report Share Posted April 14, 2010 I have several macros that switch from an application to an Excel spreadsheet, copy data and then switch back to the application to paste the data. I use, for example, <ACTIVATE2:CREDIT CARD TRANSACTIONS .xlsx> Usually this works OK but occasionally the macros do not switch to Excel. The Excel tab at the bottom of the screen will wink orange a couple of times and then stays orange. Anyone any ideas why and how to stop this happening? Quote Link to comment Share on other sites More sharing options...
Yehnfikm8Gq Posted April 15, 2010 Report Share Posted April 15, 2010 (edited) It sounds like Excel is trying to get your attention because it is trying to get focus but is being held back by another application. The general idea of the flashing is not to steal focus from the foreground application (behaviour set in registry, HKEY_CURRENT_USER\Control Panel\Desktop, ForegroundFlashCount). Only you can see what else is running - the application you mentioned plus whatever. The other application may be hanging things up a bit. When you activate Excel you could add a delay of say 1 sec (trial and error) then activate again. Alternatively put in a loop that checks if Excel is focused and if not, make it so (Jean Luc Picard's words, not mine!) (edit) Another aspect could be that when copying data, you are trying to activate Excel too soon. Large amounts of data take time to copy to the Clipboard. You should allow a time delay before the activation. I use anywhere from 10mS to 2secs. Edited April 15, 2010 by JohnS Quote Link to comment Share on other sites More sharing options...
pblomfield Posted April 23, 2010 Author Report Share Posted April 23, 2010 John, Thanks for the help , much appreciated. I still haven't solved the prob but I haven't been able to try all your suggestions yet. I've made sure nothing else is running and 9 times out of 10 it runs Ok. Then, just when I'm thinking we've cracked it it hangs. I'll try playing with delays and see if there's any improvement. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.