Jump to content
Macro Express Forums

Problems with "Activate Window" command


gbell

Recommended Posts

Hi all,

 

First of all, I love this program. I have written hundreds of macros with ME since I took my current position, and this is the first issue I have ever had with it. To be honest it is very frustrating because it seems like there is a simple solution that is just evading me. Here is the problem:

 

This macro copies a string of information from one program, activates another program (program #2), pastes the string into that window, and hits enter. It’s just a very simple macro that I wrote years ago, and it has been working great all that time. Now they have moved program #2 to a different server, and the macro will no longer work. The program has not changed at all, it was just moved. What’s happening is that when the macro gets to the point where it is supposed to activate the program the window never comes up and the macro ends up pasting the string into the original window. To be clear, it is not launching anything. All of these programs are already running. It is just supposed to activate the window.

 

Simple problem right? I should be able to fix this with a delay, or a "wait until window active" type command, but I can't. Its not a delay issue, because I can sit there and wait indefinitely and the window never activates. That said, I know that even though the window hasn't activated ME thinks it has, because when I put the "Wait until...." command in it proceeded as if it thought the window was active.

 

I have tried everything I can think of, but the only thing that works is to add a pause and have the user manually activate the window. For a number of reasons (which I won't bore you with) that is not a good solution.

 

Any ideas?

Link to comment
Share on other sites

I have a somewhat similar problem and I'll share my solution to see if it helps. A macro needed to activate a Datatel Benefactor user interface (UI) window, but Datatel's UI has one hidden text-only window that has EXACTLY the same window title. When I sent the macro command activate window for that title, it was anyone's guess which one ME3 would activate. I have gotten around the problem in one of two ways, depending on the circumstances.

1. Before the macro starts, have the user, activate the elusive window, then the less elusive one in that order. Then in the macro, use the macro command Minimize window for the less elusive one, and the elusive one should be the "next in line."

2. Another way I have handled it is to avoid using Excel or any other open file as a source file to copy data from and instead use the ASCII File Begin Process command. It both saves time and eliminates worries about activating the right window at all, because the text file is processed in the background. This is the solution I recommend most highly, but the first is worth a try too.

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...