The 8 Mistery - Iterations stopping always at iteration 8

Hi,
I have a setup made with iterations, where it splits to multiple files according to the ID code in one of the excel files, I made a test with a file that contains 60 codes, but the loop always seems to stop at iteration 8. No matter the number of codes I remove, it always stops at iteration 8.

At first I thought it could be system resources, but my machine goes maximum at 45% capacity.

The issue seems to be in the final step when it is calling the macro to run.

I always get the following errors:

Error: Iteration of module “Main” failed on iteration #8.
Source: action “Iterate”, table “File_XXXXXXxlsx”

Called module: module “Main”
Overridden parameters:
{Code ID} = XXXXXX

Error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED))
Source: action “Excel command (experimental)”, table “To Add List of Values to the Excel - Final Step - RUN MACRO”

Thank you very much.

Hi @JoMar,

This seems like an issue with the executed macro.

Can you please:

  • Close all the Excel windows
  • Make that error appear again
  • Open Windows Task Manager and check if there are any hanging Excel processes
    and tell me the number of processes if there are some.

Also, can you please try to add a delay for 15 secnods after the Excel command action (using the “Wait” action).

Hi,
Only one process seems to be running:

I added the 15 seconds, but still the iteration stopped at the number 8.

image.

Thank you.

Made a couple more tests, removing the Iteration condition “halt on error” and leaving it to continue on error.
It seems that iteration still stops at 8, leaving that file still open, you can see it in the Task Manager, but it then proceeds to the rest of the iterations, but at some point it does not process the whole VBA statement, the machine keeps running fine at 45% max memory usage and around 25% CPU, so all good here.

Hi @andrew.rybka, made some changes in macro, but issue continues, more than happy to share the project if necessary. Thx.

Hi @JoMar,

Sure. Please send your project to our support email. Will it be possible for you to share all the involved files too?

1 Like

Hi @JoMar,

I’m not sure what’s causing this error, but I was able to make your project successfully complete at least 12 iterations by adding a delay to your macro after the second call to the Save() method with the following line:

Application.Wait (Now + TimeValue("0:00:10"))

Can you please check this fix on your side? Will you be able to run successfully all the iterations?

Hi @andrew.rybka,
I added that and removed one of the saves in the end, while it processed all data and returned all files, the error still happened at the iteration 11 in first then and then again in the 8 in the second test, but all files were created.

Hello, JoMar.

If you haven’t found a solid solution for this yet, where errors don’t occur at all, I’d be happy to take a look at it for you. I spend most of my days in EasyMorph and Excel VBA.

Craig

Hi @CraigT,
That would be great, I moved to another computer and it worked fine, but moment I add more lines of code (simple color and border), and issue appeared again. I will message you. Thanks a lot in advance.

You’re welcome, JoMar. I’m around all day and have time to look at it. :+1:

1 Like