+ Reply to Thread
Results 1 to 4 of 4

Macro to refresh query.

  1. #1
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Macro to refresh query.

    I currently have a macro that opens a spreadsheet updates the information and closes it. However, some of the data in the worksheet is from an outside query. So everytime the spreadsheet is open it asks to enable automatic refresh. I have used Application.DisplayAlerts = False so I do not see any of the message boxes, so it does not update the information I need. Is there a way to have it click enable auto refresh or once the sheetis opened to refresh the query to ensure all of my information gets updated.
    Last edited by CJPHX; 09-20-2010 at 01:47 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to refresh query.

    Hello CJPHX,

    Since queries can take many forms, it would be helpful if you were more specific. I gather from your post you are referring to a web query you created using the Excel menu. It would save time if you can post a copy of the workbook. The query can then be modified directly.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: Macro to refresh query.

    I will try to post a copy of the workbook but it has so much information in it. The query is actually a table/range that just imports data from a .csv file that is saved on a different server. So it asks me to refresh external data.

  4. #4
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: Macro to refresh query.

    I have decided I can use this code to solve what I need. I select a cell within the range that needs to be refreshed.

    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)

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