LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Excel queries

Hi Ben,

Ben wrote:
I took off the auto refresh and just use the code you provided. It
worked very nicely. Thanks so much.


Great - glad to help!

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]


Hi Ben,

I don't know that you can get rid of the warning dialog that comes
up if you've selected automatic refresh on open via the query table
properties.

However, you could add this code to the ThisWorkbook object's code
pane in the VBE:

Private Sub Workbook_Open()
Dim ws As Worksheet
Dim qt As QueryTable

For Each ws In Worksheets
For Each qt In ws.QueryTables
qt.Refresh
Next qt
Next ws
End Sub

This will refresh all of the query tables in your workbook. Now,
you'll see the macro security warning instead, so maybe it's not any
better. But to get around that, you could sign the code so you
don't get the macro security warning.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]

Ben wrote:
Hi all

I have set up queries in Excel using:
Data-Import External Data-New Database Query

After I saved the workbook with the queries, I close it and re-open
the workbook. That's when a prompt keeps popping up every time I
re-open the workbook asking me if I want to do a query refresh. It
gave me two options: [Enable automatic refresh] [Disable automatic
refresh]

I want it to retrieve the data every time I open the workbook, but
is there any way to disable this pop up prompt by changing certain
setting or is there a programmatic way to disable it at run time?
Thanks for sharing your suggestions.

Ben



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
queries in excel gaby elia Excel Discussion (Misc queries) 2 June 2nd 08 01:37 PM
Web Queries Excel 97 Dave Excel Discussion (Misc queries) 0 June 16th 06 05:23 AM
Web queries and Excel SmilingPolitely[_3_] Excel Programming 0 April 14th 05 08:53 AM
excel queries vivitz Excel Programming 1 June 24th 04 12:27 PM
Excel-Web Queries M Excel Programming 5 February 6th 04 03:44 PM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"