Jump to content
Macro Express Forums

<arrow Down> Command


nick_p

Recommended Posts

Hello all - I am a new user to ME, and I seem to be running into a wall with this macro I am trying to write. I have searched with key words "arrow key" and "<arrow down>" and didn't find any posts with a similar problem.

 

I am trying to write a macro that will open and mine reports on a daily basis. These reports always have the same first 4 characters in the file name day-to-day, but the rest of the file name is often variable (and semi-unpredictable). So what I am doing to try to get to this report is activate the "Open Report" command from the File menu, type in the first four letters of the report which activates the automatic drop-down menu from which I can select the correct report, then press the down arrow to select the first(and only) report in the drop-down menu, and press enter.

 

This is where I am getting an error. Even though the command seems to work (it's not actually typing out the characters "<ARROW DOWN>"), the arrow key never seems to get pressed, which causes the macro to look for a report named just those first characters, which of course doesn't exist. Can anyone tell me what's going on?

 

Thanks!

Nick

Link to comment
Share on other sites

In cases like this, it is sometimes just a matter of speed. The macro may be sending the arrow down command before the query has had time to complete. You may want to try breaking up the text type command with a small delay, such as 2 or 3 milliseconds. This should allow the computer ample time to finish the query, fill in the field and then press the arrow down.

Link to comment
Share on other sites

And since you're likely to have to introduce such delays into more than one macro, an approach I often use is to store the delay time (e.g. 100 milliseconds) into the registry, and have each relevant macro retrieve that value. Then, if you need to change the value, you need change it only in one place.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...