Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 41
Default Refresh Data on hidden worksheet <--help please

On Dec 12, 2:50 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
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- Hide quoted text -


- Show quoted text -


Thanks for the help. I tried this code but am still getting a DEBUG
error from this line:

..QueryTable.Refresh BackgroundQuery:=False

Regards,
Dan
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Refresh Data on hidden worksheet <--help please

Sorry... IIRC the sheet does not need to be visible. Try this (once again
untested but I think it should work)...

Sub JCW_Refresh()
Sheets("ODBC Updates").QueryTables(1).Refresh _
BackgroundQuery:=False
End Sub

--
HTH...

Jim Thomlinson


"Dan" wrote:

On Dec 12, 2:50 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
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- Hide quoted text -


- Show quoted text -


Thanks for the help. I tried this code but am still getting a DEBUG
error from this line:

..QueryTable.Refresh BackgroundQuery:=False

Regards,
Dan

  #4   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 41
Default Refresh Data on hidden worksheet <--help please

On Dec 12, 3:33 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
Sorry... IIRC the sheet does not need to be visible. Try this (once again
untested but I think it should work)...

Sub JCW_Refresh()
Sheets("ODBC Updates").QueryTables(1).Refresh _
BackgroundQuery:=False
End Sub

--
HTH...

Jim Thomlinson



"Dan" wrote:
On Dec 12, 2:50 pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
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- Hide quoted text -


- Show quoted text -


Thanks for the help. I tried this code but am still getting a DEBUG
error from this line:


..QueryTable.Refresh BackgroundQuery:=False


Regards,
Dan- Hide quoted text -


- Show quoted text -


Perfect! Thanks much for the assistance.

Dan
Reply
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
External Data Refresh all just for one worksheet Andy Excel Discussion (Misc queries) 3 April 23rd 09 03:33 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
How do I detect hidden worksheets or hidden data on a worksheet? Alice Excel Discussion (Misc queries) 4 August 24th 06 03:38 AM
How To Refresh Chart Data Without Calculating The Worksheet Carl Bowman Charts and Charting in Excel 5 January 19th 05 09:28 PM
Saving hidden data with a worksheet (preferably without using a hidden sheet) Dick Kusleika[_3_] Excel Programming 2 January 21st 04 04:39 PM


All times are GMT +1. The time now is 08:57 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"