+ Reply to Thread
Results 1 to 6 of 6

Large macro loop times out

  1. #1
    Registered User
    Join Date
    01-01-2013
    Location
    melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Large macro loop times out

    Hi,

    I have a macro that produces around 1500 documents. This is about 1gig of data and takes about 7hours

    they are produced 1 at a time via a loop but after about 700 or so the marco always stops.

    it doesnt bring up and error message it just stops working. i can then subsequently start it again for the remiander but does anyone have an idea why it might just stop?

    is there a default loop counter, or something default within excel that wouldnt let this continue? or more likely a hardware issue ie not enough ram?
    Last edited by rossg; 01-03-2013 at 06:26 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646
    There aren't any defaults like that but you might be right about memory.

    Hard to tell what the problem is and how to fix it without seeing the code.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Large macro loop times out

    Please post the code as Norie suggested, and I will happily have a look at it
    If you like my contribution click the star icon!

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Large macro loop times out

    Make sure that you are clearing memory as you move along. For example arrays can be deleted, objects can be set to nothing, strings can be set to nullstring, etc. This can clear up memory between loops.

    I have macros that run for days and no issues even though when they run they take up ~80% of my 12 GBs of RAM and almost 100% of my CPU.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    01-01-2013
    Location
    melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    55

    Re: Large macro loop times out

    thanks ill look into the nullstring and deleting objects between loops.

    if it still doesnt work ill post the code on a new thread

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: [solved] Large macro loop times out

    OK. Good luck.

    abousetta

+ 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