+ Reply to Thread
Results 1 to 4 of 4

Wait is interrupting calculation

  1. #1
    Registered User
    Join Date
    06-04-2019
    Location
    NY
    MS-Off Ver
    Pro plus 2010
    Posts
    3

    Wait is interrupting calculation

    I have an excel file with an addin. When i open the file the addin automatically does a recalc. I want to automate opening the file, allowing it to refresh and then saving some columns to a csv file and close the file. When i open the file it takes about 30 seconds to refresh all formulas.

    In my VBA i call calculateAll 2 times and then Wait for more than a minute. the formulas never completely refresh. I have added multiple wait calls adding up to more than 3 minutes and the formulas never full refresh.

    Any help greatly appreciated

    sub grrr
    Application.CalculateFull
    Application.CalculateFull

    Application.Wait (Now + TimeValue("0:00:20"))
    Application.Wait (Now + TimeValue("0:00:20"))
    Application.Wait (Now + TimeValue("0:00:20"))
    ....

    end sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Wait is interrupting calculation

    Create a separate procedure that does what you want to do after the calculations. Then use Application.OnTime to call that procedure 2 minutes in the future.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

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

    Arrow Re: Wait is interrupting calculation


    Or just checking obviously the CalculationState property, to see in VBA help …

  4. #4
    Registered User
    Join Date
    06-04-2019
    Location
    NY
    MS-Off Ver
    Pro plus 2010
    Posts
    3

    Re: Wait is interrupting calculation

    Thanks AlphaFrog, that works if i open the file manually.

    But when i use windows task scheduler excel crashes. The details from event viewer are:

    Faulting application name: EXCEL.EXE, version: 14.0.7264.5000, time stamp: 0x5fda5e72
    Faulting module name: EXCEL.EXE, version: 14.0.7264.5000, time stamp: 0x5fda5e72
    Exception code: 0xc0000005
    Fault offset: 0x001de26d
    Faulting process id: 0x870
    Faulting application start time: 0x01d769f76cd40544
    Faulting application path: C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE
    Faulting module path: C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE
    Report Id: aeab09ae-d5ea-11eb-99b0-000c295fc34e



    Thanks in advance

+ 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. Wait for one IE page to load then wait for a second
    By ckemp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2017, 11:29 AM
  2. Interrupting code
    By excelbobabc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2010, 10:46 AM
  3. Wait with calculation of other sheet references after edit a cell?
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2006, 03:30 AM
  4. Interrupting initializing stage
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2006, 08:30 AM
  5. Interrupting a Loop
    By Maxi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2006, 02:15 PM
  6. [SOLVED] Interrupting A Worksheet Calculation
    By carl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2005, 03:18 PM
  7. [SOLVED] Interrupting an endless loop
    By davegb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2005, 02:06 PM

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