Marco randomly breakdown/skip loop

ccdtzccdtz

New Member
Joined
Mar 18, 2015
Messages
1
I have used VBA to code a small program (couple thousand lines) that operate a pretty complicated process and create outputs of many records. Recently we've been trying to test it on different machines and problems come up. 4 out of 6 computers generated same and correct outputs while the other two didn't. But while I rerun this program on these two, they seemed to work just fine. I checked the result of the two wrong outputs, inconsistencies happened on two different records. My clues so far:

1. 4 out 6 computers (Same Excel and Windows 7) use this program just fine which suggests nothing wrong with the coding;
2. If I re-run the other two, they also generate right result, which also suggests the program works fine;
3. The fact that wrong records in those two unsuccessful files are different rows suggests the error is random;
4. In the output file, two records form a row and many rows are generated from the main loop. For the two wrong records, the problem is always, for some reason, current loop didn't work property and used result from previous loop. But next loop worked fine. Random loop breakdown?

Sorry I couldn't attach my code here because it is too long and I am not allowed to publish it. I also don't think it is due to bugs from the VBA code. It sounds to me, is certain windows real-time operations interfere my program but I am not sure. And yes, when I used those computers to run my program, it was running in the background so my colleagues were operating normally on those computers.

Also, if this is random, is there anyway to prevent this from happening or at least detecting it?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,215,432
Messages
6,124,859
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top