ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create List of Queries (https://www.excelbanter.com/excel-programming/320809-create-list-queries.html)

dave

Create List of Queries
 
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

Rob van Gelder[_4_]

Create List of Queries
 
Sub test()
Dim qtb As QueryTable

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

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"dave" wrote in message
...
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





All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com