Luke;
However, placing the stop doesn't seem to be changing anything. With no stop, the keys are sent at the end. With the stop, they don't seem to send at all!
Are there other methods of pausing to send the keys? I already tried inserting
Application.Wait Time + TimeSerial(0, 0, 1)
after the Sendkeys statement, to no avail.
Application.Wait doesn't stop for input from the keyboard. It just stops the macro for the specified amount of time before continuing. You might use it to have a macro wait for a web page to finish loading, or in a trivia app wait for a specified amount of time before automatically displaying the answer, etc.
I was wrong about using stop
The keys will be sent to wherever the cursor is when the stop occurs. When your macro hits the "Stop" it places the cursor in the Code Window with the Stop in it, and the keys in the buffer would then be sent there.
I've only used SendKeys when I'm writing code, not running a macro.
One of the things I have discovered is that SendKeys is picky about how it works on different computers.
I have a macro that used SendKeys and it worked fine on my desktop computer, but didn't work at all on my laptop. Both computers are using Vista, so it confuses me why it won't work, but it doesn't. http://www.excelforum.com/excel-prog...ith-vista.html
These are some things you can try, but if they don't work, you'll have to find someone else to help.
You can keep it as 2 lines, but each one should have True as second argument.
You might try Application.Sendkeys instead of Sendkeys, but my gut tells me that won't make a difference, since you're trying to send keys to a directory window and not an Excel window.
Final Note:
Your macro is very inefficient. You do not need to keep "Selecting" different things. The only thing you need to "Select" or "Activate" is the window that needs to receive the SendKeys string.
There are very few things in Excel that require you to "Select" or "Activate" before doing.
Also, you should not hard code any addresses (Like "B8") in a macro. It may not matter now, but as you develop more macros, you will regret having them hard coded. You should use Range Names, or at the very least assign the Address to a variable and use the variable throughout your code. Then when you need to change the address, you only have to change it in one place.
Example:
If you use this approach you won't need to use SendKeys at all.
Bookmarks