Create List of Queries

D

dave

xl 2002 windows xp profesional

Issue: Have a macro running that periodically switches
from sheet to sheet to allow users to view varying data on
a large TV screen. Book has queries to get data from web
sites that are up set to update at specified times, but
with the macro to change sheet running all day long it
doesn't update.

My fix would be to force an update within the sheet
switching macro.

Need a code snippet to a) list the names of all queries to
make sure I have proper name and don't miss any; and b)
the code to force the update when on that sheet.

TIA
 
R

Rob van Gelder

Sub test()
Dim qtb As QueryTable

For Each qtb In ActiveSheet.QueryTables
qtb.Refresh
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top