+ Reply to Thread
Results 1 to 3 of 3

Code Executes Before Function Updates Data

  1. #1
    Forum Contributor
    Join Date
    06-18-2007
    Location
    Kiama, Australia
    MS-Off Ver
    365
    Posts
    119

    Code Executes Before Function Updates Data

    I have a workbook that uses a function via an Excel Add-In.
    My VBA code is executing before the function finishes collecting data from a network server.
    Consequently I end up with #REGISTER in my output instead of numerical values.
    How can I make the macro wait until the data update is complete before continuing execution?
    Last edited by OzTrekker; 06-19-2014 at 09:30 PM.

  2. #2
    Forum Contributor
    Join Date
    06-18-2007
    Location
    Kiama, Australia
    MS-Off Ver
    365
    Posts
    119

    Re: Code Executes Before Function Updates Data

    I've just discovered that even if I set Calculation to Manual the Add-In function still pulls data from the server.
    It must be using DDE.
    That probably explains why the following code doesn't halt execution until data update is completed.
    Can somebody confirm my suspicions and/or suggest a solution?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-18-2007
    Location
    Kiama, Australia
    MS-Off Ver
    365
    Posts
    119

    Re: Code Executes Before Function Updates Data

    Problem solved.
    I simply paused the macro for 5 seconds with the following simple procedure.
    This allows the data update to finish prior to macro execution continuing.

    Please Login or Register  to view this content.

+ 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. Code Executes Before Add-In Data Updates
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2014, 02:16 AM
  2. Code executes 8 times without loop statements. Why?
    By contaminated in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2010, 05:02 PM
  3. MsgBox does not appear after the code executes.
    By contaminated in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2010, 07:49 AM
  4. Code only executes correctly when run from certain worksheet
    By jbguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2009, 05:12 AM
  5. Vba Code Executes After Copying Sheet
    By RichG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2007, 09:09 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