koden Posted March 21, 2006 Report Share Posted March 21, 2006 When the first IF is true (if T9 contains T5 and T6) it shut down the window OPC and the window request, BUT ends with an error. The window OPC is not active.....and macro stops.. have i forgotten something?? OR,ELSE,ENDIF ??? I'm going to use the macro tomorrow, so If anyone have the time, I would be pleased test1.mxe Quote Link to comment Share on other sites More sharing options...
jason Posted March 21, 2006 Report Share Posted March 21, 2006 We need a little more information. When you step through the macro, which line number is having the problem. Also, what is the exact error that you are getting? Quote Link to comment Share on other sites More sharing options...
koden Posted March 21, 2006 Author Report Share Posted March 21, 2006 I'm not sure, but I can try tomorrow morning.. I just know that it delete the mail and shut down the request as it has to do in the first IF statement. After there the error comes, that tells it can't activate OPC. (OPC is the mail that it has shut down in the first IF statement). But anyway...I can see it's dificult to help with this inf. I will get some more inf. :-)) Quote Link to comment Share on other sites More sharing options...
koden Posted March 22, 2006 Author Report Share Posted March 22, 2006 I have tested now... This happens: The first IF statement is true (save all job...txt contains the same as T5 and T6) The macro close the OPC mail and the request (as the IF statement tells it to do). Then I can see the macro does the paste T5 and T6 into save all job...txt. And just after this it says: The specified window OPC could not be found on your computer. The macro will be aborted. This is what should have been happend: After the first IF statement have been done (because it was true), the macro should jump to the last ENDIF in this macro. Quote Link to comment Share on other sites More sharing options...
jason Posted March 22, 2006 Report Share Posted March 22, 2006 The End If statement on line 55 needs to be removed. If Variable %T8% does not contain "Tryg" Delay 1000 Milliseconds Activate Window: "OPC" Delay 500 Milliseconds Wait For Window Title: "OPC " Delay 500 Milliseconds Text Type: <CONTROL>w Delay 500 Milliseconds Text Type: <ALT>n Delay 500 Milliseconds Text Type: <ARROW DOWN> Delay 1000 Milliseconds Activate Window: "Request E50" Delay 500 Milliseconds Wait For Window Title: "Request E50" Text Type: <ALT>c Delay 1000 Milliseconds End If Else Your code should look like this: If Variable %T8% does not contain "Tryg" Delay 1000 Milliseconds Activate Window: "OPC" Delay 500 Milliseconds Wait For Window Title: "OPC " Delay 500 Milliseconds Text Type: <CONTROL>w Delay 500 Milliseconds Text Type: <ALT>n Delay 500 Milliseconds Text Type: <ARROW DOWN> Delay 1000 Milliseconds Activate Window: "Request E50" Delay 500 Milliseconds Wait For Window Title: "Request E50" Text Type: <ALT>c Delay 1000 Milliseconds Else The End If command terminates the IF statements which will cause your ELSE statement to be executed regardless of IF statements. Quote Link to comment Share on other sites More sharing options...
koden Posted March 22, 2006 Author Report Share Posted March 22, 2006 Ohh.. I think you look at the first attached macro. I have attached a new one. Sorry...I schould have wrote that. The first one was called test. The new one test1. But it was the same problem, so This works now...ENDIF in line 21 has to be deleted BUT then I got a new problem :-) Now when endif line 21 is gone line 21 is if variable T8 does not contain Tryg This IF statement doesnt work if T8 contains f.ex. "5 test af ikke" So the first IF statement with T5,T6 and T9 is not true. That works. But when the second statement is true: if variable T8 does not contain Tryg Then it seems to jump out of this macro and go on with the next macro. Do I have a problem with my endif??? :-) Quote Link to comment Share on other sites More sharing options...
koden Posted March 23, 2006 Author Report Share Posted March 23, 2006 Hmmm...working now. Have removed else and put endif after the 3 statements. Test2 is attached... test2.mxe 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.