Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formatting after Web Query Refresh

Hi friends

I am using a Web Query to download some stock related data.
The fonts on the web page are of small size and the heading are
in black color as well the data too.

What I did to change the size and color is :

Range("B12").Font.Bold = True
Range("B12").Font.Size = 10
Range("B12").Font.Color = RGB(255, 0, 0)

I have written this code after refreshing the web query. This piece of
code works
for some time....but then font and other things get their original
color and size...
The effect is till the refresh icon is working after that no use of
this piece of code.
I have written this code after the refresh event!!!!!!!!!!

Please put some light on this area.....

Thanks in advance
Anand

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Formatting after Web Query Refresh

Unless you set it up otherwise a query will do a background refresh; that is,
it allows work to continue in Excel while it waits for the data. This also
means your code can continue to run. There are two ways around this:
1) Set the .BackgroundQuery property of the querytable to False
2) In your code you can check to see if the refresh is done with a loop, as
illustrated below (and I am also including a time-out in case the web data is
unavailable):
TimeOut = Now()+TimeValue("00:02:00") ' 2 minute timeout
My QueryTable.Refresh
While MyQueryTable.Refreshing And Now() <= TimeOut
DoEvents
' you can do other processing here, also, if needed
WEnd
' put your formatting code here

--
- K Dales


" wrote:

Hi friends

I am using a Web Query to download some stock related data.
The fonts on the web page are of small size and the heading are
in black color as well the data too.

What I did to change the size and color is :

Range("B12").Font.Bold = True
Range("B12").Font.Size = 10
Range("B12").Font.Color = RGB(255, 0, 0)

I have written this code after refreshing the web query. This piece of
code works
for some time....but then font and other things get their original
color and size...
The effect is till the refresh icon is working after that no use of
this piece of code.
I have written this code after the refresh event!!!!!!!!!!

Please put some light on this area.....

Thanks in advance
Anand


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
How can I 'Enable Automatic Refresh' for Query Refresh by default Anand Deshpande Setting up and Configuration of Excel 0 December 10th 06 04:47 AM
Query Refresh-Enable Automatic Refresh Dialogue Box Terri Excel Discussion (Misc queries) 0 May 6th 05 08:21 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM
Web Query fail to Refresh All but individual refresh is ok Karyn Mak Excel Programming 2 July 17th 03 09:30 AM


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