Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Aug 2002
    Location
    MN, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Web query refreshes (2002)

    I have a file that has web queries that need to occur weekly. There are 16 weeks that need to be updated and 12 queries for each week. I have each query on it's own worksheet. These worksheets are hidden from the user.

    Is there a way to run each week's refreshes without doing the other 180 queries? I don't want to do the 12 for each week manually and I really don't want to waste time/resources by refreshing all the queries. Maybe a button for each week that will trigger the correct group of refreshes?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Web query refreshes (2002)

    A query table is an object in a worksheet. you could use something like:
    <pre>Worksheets(1).querytables(1).refresh</pre>

    Or if you know the names you can use the names instead of the indices:
    <pre>Worksheets("Sheet 1").querytables("Query 1").refresh</pre>


    Possibilities:
    You could name each one, based on when you want to refresh and then loop thru them all and only refresh those with a particular name format. You could have a button for each type or call one macro that prompts for a type or a userform where you can select the type and then it loops thru them. This way adding more would NOT change the macro, add ing a new one would ONLY require naming it correctly so it gets refreshed when desired.

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •