Skip to main content

Canceling a macro on error

I stack all my macros together and use a "master" macro to run them sequentially. It allows me to simplify and compartmentalize the code. The problem is if I get an error. The code continues to run from the master program. Any suggestions on how to stop it? Below is a snippet of the macro that runs the other macros.

Thanks,
Randy
ProjectLocation = Client.WorkingDirectory()

------ If there is an error in the import Macro all the other macros will run
Client.RunIDEAScript ProjectLocation & "Macros.ILB\001 Import Files.iss"
Client.RunIDEAScript ProjectLocation & "Macros.ILB\002A General Ledger-Cash.iss"
Client.RunIDEAScript ProjectLocation & "Macros.ILB\002B General Ledger - ACSGFI.iss"
Client.RunIDEAScript ProjectLocation & "Macros.ILB\002C General Ledger-Credit.iss"
Client.RunIDEAScript ProjectLocation & "Macros.ILB\003A Monthly ACS Totals.iss"

Brian Element Sat, 09/13/2025 - 08:34

Hi Randy,

Instead of using the Client.RunIDEAScript use Client.RunIDEAScriptRV, this allows you to return a variable.  If you encounter an error in the called file then you return a flag saying there was an error and check the variable before calling the next iss file.

randywb Mon, 10/13/2025 - 14:36

I got around to testing this function and couldn't get it to work. I used a generic script to pass values, and the values would not pass in. I modified values in the script that was called, and they did not pass back. I see that a lot of others could not get it to work and used a text file. If I am unsuccessful after this post, I will do that or possibly use a database.

Any ideas of what I could be doing wrong.