View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Refresh Data on hidden worksheet <--help please

Try something more like this...

Sub JCW_Refresh()
application.screenupdating = false
with Sheets("ODBC Updates")
.visible = xlsheetvisible
.QueryTable.Refresh BackgroundQuery:=False
.visible = xlsheethidden
end with
application.screenupdating = true
End Sub
--
HTH...

Jim Thomlinson


"Dan" wrote:

Hello -

I have some VBA which will REFRESH DATA on a worksheet. However, when
the worksheet is hidden, the macro will not work.

How can I get this code to work on this HIDDEN WORKSHEET?

Sub JCW_Refresh()
Sheets("ODBC Updates").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
Sheets("JCW").Select
End Sub

Thanks for helping out this rookie.
Dan