+ Reply to Thread
Results 1 to 3 of 3

reliability of macro results

  1. #1
    Registered User
    Join Date
    06-09-2004
    Location
    Los Angeles, California
    Posts
    28

    reliability of macro results

    I'm having some reliability issues with a "super-macro" I'm currently using. This macro -- which calls on several sub-macros -- is quite process-heavy and operates on worksheets that often have thousands of rows. Much of the "processing" involves search and replace or search and delete. E.g., replace "&" with "and".

    Unfortunately, the "super-macro" will randomly miss a replace or delete. The problem does not crop up frequently, but the results do cause problems with programs this worksheet ultimately interfaces with.

    I have removed speed-optimizing code which I thought may be a culprit. I.e.:

    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    [ your code ]

    Application.ScreenUpdating = True
    Application.Calculation=xlCalculationAutomatic

    But the reliability remains unchanged.

    Any info on how I can improve reliability is appreciated!
    -KH
    Los Angeles, California

  2. #2
    Nigel
    Guest

    Re: reliability of macro results

    Check you data, then check it again, inevitably in these situations the code
    you thought acted on data correctly comes across a piece of corrupt or
    unexpected piece of data that causes your code to fail. Even a space in the
    wrong place (difficult to see if they appear at the end of a string!) can
    cause problems.

    It is unlikely to be 'random' , although it may appear to be! - try setting
    up the same start conditions and run the code again, put a conditional watch
    in to check for value changes that are invalid, and also use breaks to halt
    code execution at the appropriate place.

    Chunk up you code into more manageable blocks - maybe it is the same
    sub-routine causing the problem - check each using the above approach.

    Hope the above helps. Good luck.
    --
    Cheers
    Nigel



    "KHashmi316" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I'm having some reliability issues with a "super-macro" I'm currently
    > using. This macro -- which calls on several sub-macros -- is quite
    > process-heavy and operates on worksheets that often have thousands of
    > rows. Much of the "processing" involves search and replace or search
    > and delete. E.g., replace "&" with "and".
    >
    > Unfortunately, the "super-macro" will randomly miss a replace or
    > delete. The problem does not crop up frequently, but the results do
    > cause problems with programs this worksheet ultimately interfaces
    > with.
    >
    > I have removed speed-optimizing code which I thought may be a culprit.
    > I.e.:
    >
    > Application.ScreenUpdating = False
    > Application.Calculation = xlCalculationManual
    > [ your code ]
    >
    > Application.ScreenUpdating = True
    > Application.Calculation=xlCalculationAutomatic
    >
    > But the reliability remains unchanged.
    >
    > Any info on how I can improve reliability is appreciated!
    >
    >
    > --
    > KHashmi316
    >
    >
    > ------------------------------------------------------------------------
    > KHashmi316's Profile:

    http://www.excelforum.com/member.php...o&userid=10439
    > View this thread: http://www.excelforum.com/showthread...hreadid=380775
    >




  3. #3
    Registered User
    Join Date
    06-09-2004
    Location
    Los Angeles, California
    Posts
    28

    re: reliability of macro results Reply to Thread

    Hi, Nigel:


    The "super-macro" is quite a lengthy chunk of program, so tracing thru it is going to be bit of a task.

    IAC, I think this will initially be a needle-in-a-haystack troubleshoot ... at least until I have run the macro a few dozen more times to build up enough empirical evidence to speculate on a culprit. Since the macro can take up to an hour to complete -- per worksheet -- this may take a while.

    Thx for your reply!


    Quote Originally Posted by Nigel
    Check you data, then check it again, inevitably in these situations the code
    you thought acted on data correctly comes across a piece of corrupt or
    unexpected piece of data that causes your code to fail. Even a space in the
    wrong place (difficult to see if they appear at the end of a string!) can
    cause problems.

    It is unlikely to be 'random' , although it may appear to be! - try setting
    up the same start conditions and run the code again, put a conditional watch
    in to check for value changes that are invalid, and also use breaks to halt
    code execution at the appropriate place.

    Chunk up you code into more manageable blocks - maybe it is the same
    sub-routine causing the problem - check each using the above approach.

    Hope the above helps. Good luck.
    --
    Cheers
    Nigel



    "KHashmi316" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I'm having some reliability issues with a "super-macro" I'm currently
    > using. This macro -- which calls on several sub-macros -- is quite
    > process-heavy and operates on worksheets that often have thousands of
    > rows. Much of the "processing" involves search and replace or search
    > and delete. E.g., replace "&" with "and".
    >
    > Unfortunately, the "super-macro" will randomly miss a replace or
    > delete. The problem does not crop up frequently, but the results do
    > cause problems with programs this worksheet ultimately interfaces
    > with.
    >
    > I have removed speed-optimizing code which I thought may be a culprit.
    > I.e.:
    >
    > Application.ScreenUpdating = False
    > Application.Calculation = xlCalculationManual
    > [ your code ]
    >
    > Application.ScreenUpdating = True
    > Application.Calculation=xlCalculationAutomatic
    >
    > But the reliability remains unchanged.
    >
    > Any info on how I can improve reliability is appreciated!
    >
    >
    > --
    > KHashmi316
    >
    >
    > ------------------------------------------------------------------------
    > KHashmi316's Profile:

    http://www.excelforum.com/member.php...o&userid=10439
    > View this thread: http://www.excelforum.com/showthread...hreadid=380775
    >

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1