Workbook with a lot of VBA code runs unpredictably, random subroutines get called, random crashes

  • I've been working on this workbook for about a year. Most of the functionality is done but I have issues with random crashes and occasional subroutines that get triggered for no apparent reason, i.e. I will be following along the code as it runs, line by line, but it will randomly jump to some other subroutine and run through it, even after I've gone through and removed every instance it is called.


    Additionally, the entire workbook seems to crash randomly when manipulating tables but it is inconsistent and not easy to replicate -- sometimes it happens, most of the time it doesn't. Not sure what to do at this point.

  • Hello,


    The danger with creating macros over a whole year ... is to design patches on top of patches ...


    As a result, you might end up with ' Spaghetti Code ' ... !!!


    You do know that Unpredictable Code is ... by design IMPOSSIBLE ...


    But since I do not have a crystal ball ... quite difficult to guess what is in front of your eyes ...:!:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Thumbs Up" icon, below, in the bottom right corner:)

  • Without seeing all the code, will be hard. As Roy has said the code must be linked or called to run even if that means one calling another or jumping within one procedure

    Can you
    sanitise the spreadsheet (remove data) and post so we can view the code etc. and see if any help can be given


    Also if possible flag where this are misbehaving or going not as planned

    Many thanks

    jiuk

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!