+ Reply to Thread
Results 1 to 6 of 6

Excel VBA Errors For Long Processing

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2016
    Posts
    23

    Excel VBA Errors For Long Processing

    I have a very long (> 2 hr) macro that shifts through thousands of files and creates a table of contents (more or less). Anyway, the program will operate just fine when I am also working at the same PC but if I walk away for an hour, Excel will sometimes generate an error. I believe that it has something to do with the PC going idle although it really isn't going idle because I turn off sleep and hibernate while running the macro. Also, the error does not seem to occur in the same place each time although it has happened at one point a couple times. See below:

    Please Login or Register  to view this content.
    I will get an automation error here (forgot to get the code).

    Besides the power settings which are set to "High Performance" (i.e. no sleep, no HDD turn off, etc), is there something else in the PC that would cause this behavior? Something perhaps that is not controlled by the power control settings but still goes to sleep when the PC is idle.


    Thanks,

    Mark

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Excel VBA Errors For Long Processing

    Hi,

    Difficult to comment without seeing the workbook in all its glory. However if the workbook isn't changing in any way and the process you're running is just gathering data, have you tried forcing a sheet change every so often in the workbook that contains the macro so that you can eliminate any process in Excel that thinks its asleep. Even if it's just add a dummy value to a cell.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Excel VBA Errors For Long Processing

    I change sheets in the output workbook but I haven't tried that in the macro workbook. I will give that try and report back.

    Thanks

  4. #4
    Registered User
    Join Date
    01-30-2013
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Excel VBA Errors For Long Processing

    Unfortunately, that didn't work either and I tried multiple things. Updating cells, recalculation, activation, etc. It just seems that Excel is going to sleep even though the PC stays awake.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Excel VBA Errors For Long Processing


    Try to insert a DoEvents line just before the Next line …

  6. #6
    Registered User
    Join Date
    01-30-2013
    Location
    Pleasanton, CA
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Excel VBA Errors For Long Processing

    I already have that in the code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need Excel 2007 Formula to Check For Accounting Errors in Long Column
    By alcharbonneau in forum Excel General
    Replies: 4
    Last Post: 09-14-2012, 06:16 AM
  2. processing a long list and moving content to seperate sheets
    By tsrwebman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2011, 02:58 AM
  3. Replies: 3
    Last Post: 01-22-2010, 10:08 AM
  4. Excel processing speed
    By tony.nz in forum Excel General
    Replies: 2
    Last Post: 11-13-2009, 03:42 PM
  5. [SOLVED] Excel Throwing Circular Errors When No Errors Exist
    By MDW in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-10-2006, 09:20 AM

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