+ Reply to Thread
Results 1 to 3 of 3

Automatically running a query and a macro when opening the workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    Nevada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Automatically running a query and a macro when opening the workbook

    Hi,
    I have a macro that is running correctly, and it will run when I open the workbook, the problem is that I also have a query that refreshes upon opening the same workbook, and my macro finishes before my query, so then it is "undone."

    Is there someway to get the macro to wait until the query is done before it auto-runs?

    Thanks!

  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: Automatically running a query and a macro when opening the workbook

    Hi,

    Have you tried setting the query's BackGroundQuery property to False?
    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
    03-05-2013
    Location
    Nevada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Automatically running a query and a macro when opening the workbook

    I am not sure how to do this?? I am sorry, I am new to all of this and trying to learn it, but I couldn't find what you meant on my own

    Your guidance would be much appreciated!

+ 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