ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel web auto-refresh (https://www.excelbanter.com/excel-discussion-misc-queries/207518-excel-web-auto-refresh.html)

teepee[_3_]

Excel web auto-refresh
 
Anyone know how I can update data from web once per second instead of once
per minute?

Many thanks

tp



Don Guillett

Excel web auto-refresh
 
You must have a REALLY fast connection.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"teepee" wrote in message
...
Anyone know how I can update data from web once per second instead of once
per minute?

Many thanks

tp



teepee[_3_]

Excel web auto-refresh
 

"Don Guillett" wrote

You must have a REALLY fast connection.


I do. What I need is some VBA that will issue the 'Refresh all' command
every second.



Chip Pearson

Excel web auto-refresh
 
You can use the OnTime method to call a procedure, and that procedure
can then call Refresh on the query tables. See
http://www.cpearson.com/excel/OnTime.aspx for information and example
code for using OnTime and Windows Timers.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 23 Oct 2008 17:55:27 +0100, "teepee"
wrote:


"Don Guillett" wrote

You must have a REALLY fast connection.


I do. What I need is some VBA that will issue the 'Refresh all' command
every second.


teepee[_3_]

Excel web auto-refresh
 

"Chip Pearson" wrote in message
...
You can use the OnTime method to call a procedure, and that procedure
can then call Refresh on the query tables. See
http://www.cpearson.com/excel/OnTime.aspx for information and example
code for using OnTime and Windows Timers.

many thanks chip



teepee[_3_]

Excel web auto-refresh
 

"Chip Pearson" wrote in message
...
You can use the OnTime method to call a procedure, and that procedure
can then call Refresh on the query tables. See
http://www.cpearson.com/excel/OnTime.aspx for information and example
code for using OnTime and Windows Timers.


Hmm I tried the method using Windows Timer in Excel 2007. I set a cell to
display TimerID (as below) expecting the cell to display a count every
second, but instead it jumped to 30,687 and crashed. Obviously I'm missing
something here 8-)

Any thoughts on what I'm doing wrong?

Many thanks in advance

Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
Range("a24").Select
ActiveCell = TimerID
End Sub



Chip Pearson

Excel web auto-refresh
 
I don't know why you would get such as result. I tested the code in
both XL2003 and XL2007 and it worked as expected. As is noted on the
web page, though, if the Windows timer pops when you are editing a
cell, it is quite likely that Excel will crash.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Thu, 23 Oct 2008 21:39:48 +0100, "teepee"
wrote:


"Chip Pearson" wrote in message
.. .
You can use the OnTime method to call a procedure, and that procedure
can then call Refresh on the query tables. See
http://www.cpearson.com/excel/OnTime.aspx for information and example
code for using OnTime and Windows Timers.


Hmm I tried the method using Windows Timer in Excel 2007. I set a cell to
display TimerID (as below) expecting the cell to display a count every
second, but instead it jumped to 30,687 and crashed. Obviously I'm missing
something here 8-)

Any thoughts on what I'm doing wrong?

Many thanks in advance

Sub TimerProc(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)
Range("a24").Select
ActiveCell = TimerID
End Sub


teepee[_3_]

Excel web auto-refresh
 

"Chip Pearson" wrote in message
...
I don't know why you would get such as result. I tested the code in
both XL2003 and XL2007 and it worked as expected. As is noted on the
web page, though, if the Windows timer pops when you are editing a
cell, it is quite likely that Excel will crash.


Not to worry - when I put in the command I actually want to do every
second - ActiveWorkbook.RefreshAll - it works a treat. So thanks very much
indeed for the help.




All times are GMT +1. The time now is 05:49 PM.

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