Skip to main content

IDEAScripting with Dialogs

Greetings! (edited)  This is my first post after a year being a member.
I am working in a yearly project and because of that I programmed everything in IDEA.  My Project Manager asked me to program everything in a way that anyone, with little IDEA knowledge, can run it.  I have many IDEAScripts that I wrote to perform all the analysis.  Now I added dialogs to make it easier.  Everything runs great without errors. Almost perfect! But (there's always a but)... 

  1. I prepared a main dialog with 10 buttons that open different sub-dialogs
  2. Each sub-dialog has buttons to run individual IDEAScripts.
  3. The dialogs code is very simple, from my point of view as I am almost a newbie. 
  4. I don't know if the code I used for the dialogs is correct, but it RUNS without errors.
  5. Each IDEAScript has a button to click and run. All the individual scripts run without errors.  More easier than that CAN'T be done.
  6. When I run the dialog script, I can navigate between the different dialogs without errors. I can go forward and back, without errors.
  7. When I want to exit, I just click the Cancel button. NO ERRORS

When I open the main dialog I can exit with just clicking the Cancel button. When I navigate to a sub-dialog, the Cancel button in that new dialog brings me back to the main dialog. But then I have to click the Cancel button TWICE to exit. If I navigate to a third and a fourth dialog, I have to click cancel in the main dialog 3 or 4 times. If I navigate 20 times, I have to click cancel 20 times.
That brings me to my question: How can I exit the main doalog with just ONE CLICK on the cancel button?
Attached are a couple of the dialogs scripts. All dialogs go into the Macros.ILB default folder.
Thanks for your help!
Cisco

Brian Element Wed, 03/14/2018 - 19:39

Hi xtrasico,

I have been trying for the last hour to find a solution and I haven't, this looks like a bug in IDEA where something isn't being reset when you call a dialog.  If you have a maintenance contract with them you can send it over to support.cwa@caseware.com and let them know of this bug.

Thanks

Brian

xtrasico Wed, 03/14/2018 - 21:26

Hi Brian! Yes, I have maintenance with Audimation/Caseware.  I will contact them.  That means that the code is simple and nothing seems wrong with it, right?
Thanks for your help.  I really appreciate it.

Brian Element Thu, 03/15/2018 - 04:42

In reply to by xtrasico

From my point of view the code should be working but it isn't.  I put message boxes at different places and the code seems to forget what it was doing when it left.  I also tried doing this in different scenarios and I got the same problem.  If they come back with a solution I would be interested in seeing it.  Right now the only solution is to bring the code into one large script instead of using individual scripts.

Thanks

Brian

xtrasico Thu, 03/15/2018 - 07:41

Interesting.  I will tell them your experience too. 
One large script.  Nice Idea.  I will try that.
Thanks,
Cisco

xtrasico Thu, 03/15/2018 - 11:09

I contacted Caseware and Audimation for help.  Caseware created two cases to help me.  Audimation sent an email and said they are going to do some testing and investigate to try to find a solution.  I have little faith in them though...  so, I began working in the script with various dialogs all together and it gives me the same effect when navigating between the dialogs. 
 
Maybe is the "Cancel" button or the "Select Case" for exit.
 
I wanted to look for an EXIT or CLOSE button code solution on www.mrexcel.com forums, instead of  the "Cancel" button, but our internet connection here at work is so closed and slow that sometimes not even google comes up. SUCKS!  I suppose I will take the laptop home and work with my internet connection because even with my NordVPN my internet is faster than here at work.
 
I'll keep you posted if someone provides a solution.  Thanks again!

xtrasico Thu, 03/15/2018 - 11:40

Audimation called me and provided a solution. 
 
The first script is perfect. The secondary dialog scripts I have to modify them. In each "Select Case"  I have to comment or delete the line calling the first dialog "00 AUPs Project", because it is running already. That is why I have to click twice the Cancel button.
<code>
Select Case button
Case 0 'Cancel button = EXIT
exitDialog = TRUE
Client.RunIDEAScriptEx "Macros.ILB\00 AUPs Project.iss" , "", "", "", ""
</code> 
 
Also, they told me that I could modify the script and instead of using "exitDialog = True", I could use Exit Function. I will try that now and let you know.

xtrasico Thu, 03/15/2018 - 11:59

I did the modifications and it works perfectly.  My mistake was calling the first dialog as a second argument in the "Select Case 0" (cancel button) in each sub-dialog.

Brian Element Thu, 03/15/2018 - 15:45

In reply to by xtrasico

Ok, I am banging my head against the wall.  I never bothered to look at the other scripts or else I would have realized that that was the problem, duh, I feel like an idiot for missing that.  Just teaches me I need to look further sometime.

Glad you got it working and good to hear you got some real help :-).

Brian