RWayneH
asked on
Simulate ALT+TAB in Excel macro
Is there a send.keys command to simulate the press of ALT+TAB, to get to what the previous session was.
ASKER
This is not working. It appears to take focus off the active session in excel, but does not flip the display to continue the macro. My issue is the sheet that I am ALT+TABing to has a different (random) file name each time.
Any other ideas or why this is not working?
Any other ideas or why this is not working?
You can not step through such code. How are you launching the routine?
Is the other (prior focus) window also an Excel workbook?
Is the other (prior focus) window also an Excel workbook?
ASKER
Yes the prior focus is an Excel workbook and when I step through it, it does not do anything.
what is the purpose of the focus change from one workbook to another?
ASKER
I am opening a series of files that are from a external system as .xls files, when they are exported they are given a random numeric filename like 34565434543544.xls the next could be 898989099090.xls I have over 500 hundred of them to import into a master file, so as I open a file, I am mapping data to the master workbook with a macro. I am having issues getting back and further to the files that are open. No problem with the master file because that name is static, it is the other one that is giving me issues to get to.
It would be better to automate the import, where the VBA code iterates the workbooks.
Where are the files saved?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nailed it!! Thanks.
Open in new window