+ Reply to Thread
Results 1 to 3 of 3

Force Web Pull Macro to Run First

  1. #1
    Forum Contributor
    Join Date
    08-28-2012
    Location
    nz
    MS-Off Ver
    Excel 2010
    Posts
    125

    Red face Force Web Pull Macro to Run First

    Hi

    After WorkBook Automatically Re-Opens I Need Web Pull Set to Run First

    That's all

    This is a set up example Wb



    (Please View, Wb and Click One Button To See How It Currently Runs and How It Should Run)


    Appreciate thought through assistance of Course


    Cheers Mike : )
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Force Web Pull Macro to Run First

    Hi Mike,

    You can prove that Macro1 does indeed run before Macro2, by putting the following
    statement at the top of the 1st Macro, which will invoke the debugger.
    Please Login or Register  to view this content.
    I know nothing about 'QueryTables', but the 'Wait' statements seemed to get in the
    way of the 'QueryTables' command on my Windows Vista computer using Excel 2003.
    I'm sure someone more 'QueryTables knowledgeable' than I, has an elegant solution
    to your problem.

    I was able to get the program to run quite robustly, by:
    a. Eliminating all the 'Wait' statements after the call to 'QueryTables'.
    b. Using a 'Worksheet_Change()' event on Sheet 'Tab Results' Cell 'A3'.
    By trial and error I found that when the 'Target Address' for the cell
    started with 'A3:F' that the 'QueryTables' update had completed.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-28-2012
    Location
    nz
    MS-Off Ver
    Excel 2010
    Posts
    125

    Re: Force Web Pull Macro to Run First

    Hi Metz

    Thanks for Effort good work around cool, I just downloaded wb from here myself put in correct date (12th today) went to www.tab.co.nz got race code for a finished race, Clicked "Close Wb" when it opened i got run time error, put on manual button to updae Results and that worked fine soo ? Excel never ceases to perplex.

    Any ways found out all i had to do was change ".Refresh BackgroundQuery:=True" to "False",which makes Wb query run at once,Otherwise its saying "Ok you other macros just carry on and complete ahead i'll update in the background".

    Simple but took a week to find out.

    Hope this helps someone also

    Cheers my man

    : ) Mike
    Attached Files Attached Files
    Last edited by keen2xl; 11-12-2013 at 06:54 AM.

+ 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. Force destination formatting
    By krumel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 11:31 PM
  2. Force other macros to run when a macro is run
    By Nicola13 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-12-2012, 02:18 PM
  3. Printing Macro-How can I make my print macro force excel
    By chris_mayer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2006, 09:26 PM
  4. Force Macro Enabled
    By oberon.black in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2005, 11:05 PM
  5. force a macro to execute
    By Valeria in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-05-2005, 03: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