Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default How to check if SHEET has QUERYTABLE property ?

Max,

I think you can do it easily with this

Application.DisplayAlerts = False
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
Application.DisplayAlerts = True

--
sb
"max chen" wrote in message
...
HI

I gonna refresh all sheets with following codes, but some sheets may
have NO queryTable, i.g. some sheet with only chart. Then the
sheets(nIndex).queryTable must yeild error alarm windows,:( , event on
error can not disable it.

Is there any method to check if there is queryTable property for the
SHEET, or the SHEET is chart ?

Plz help me, i'm new to excel VBA. Thanks alot .

max.


--------------------------------------------------------
Private Sub CommandButton1_Click()

For i = 1 To Sheets.Count
If Sheets(i).Name < c??sheet Then
On Error GoTo NoQueryTable

nQueryTableCount = Sheets(i).QueryTables.Count
'the above statement bring out error alarm window :(

For j = 1 To nQueryTableCount
Sheets(i).QueryTables(j).Refresh BackgroundQuery:=False
Next

NoQueryTable:
aa = "i am sad..."
End If
Next

End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default How to check if SHEET has QUERYTABLE property ?

Max,

Glad it works for you! Works for me, all the time. I have a special
toolbar button for it...

--
sb
"max chen" wrote in message
...
Thanks a lot

After I set the backgroundUpdate option of the imported data area to
false, The refreshAll do refresh all sheets. It's Great!

max.


? Thu, 21 Aug 2003 13:02:04 -0700 ?, "steve"
??:

Max,

I think you can do it easily with this

Application.DisplayAlerts = False
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
Application.DisplayAlerts = True




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
2007: Property Sheet button disabled Richard H Excel Discussion (Misc queries) 5 February 26th 08 02:21 AM
How to set text property of a check box to value of a cell? Naum Charts and Charting in Excel 5 December 11th 07 06:44 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
Best way to inser file property into and excel sheet (cell) Luc Excel Discussion (Misc queries) 3 July 5th 05 08:36 PM
Is there a Sheet delete property? David Excel Programming 5 August 21st 03 05:10 AM


All times are GMT +1. The time now is 08:14 AM.

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

About Us

"It's about Microsoft Excel"