Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dj dj is offline
external usenet poster
 
Posts: 92
Default Refreshing Web Queries and DisplayAlerts

Im working with a series of macros (Excel 2003) that schedule hourly updates
of a bunch of web queries, and then process each hour's query results. The
scheduling macro calls up the refresh and processing macros.

I have been using Application.DisplayAlerts = False in the beginning of both
the scheduling macro, and the refresh macro. None of the referenced macros
include Application.DisplayAlerts = True. However, when one of the queried
websites cannot be opened, a pop-up box states:

Unable to open http://[web address]. Cannot download information you
requested.

This box stops the macros from continuing until it is clicked by a person.
How can I stop alerts that occur during web query refreshes? Some of the
code Im using follows:

Sub SetSchedule ()
Application.DisplayAlerts = False
Sheets(Data).Select
Range(g5:z5).Select
For Each Item in Selection
Application.OnTime Item.Value, Refresh
Application.OnTime Item.Value + TimeValue(00:10:00), Macro3
Application.OnTime Item.Value + TimeValue(00:11:00), Macro4
Next Item
End Sub

Sub Refresh ()
Windows(filename.xls).Activate
Application.StatusBar = Processing Refresh
Application.DisplayAlerts = False
Sheets(Data).Select
Range(c3).Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue(00:02:30), Macro5
End Sub

Sub Macro5 ()
Application.ScreenUpdating = True
Application.StatusBar = Scheduled Updates are Running
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Refreshing Web Queries and DisplayAlerts

Try this:
Sub Refresh ()
On Error Resume Next
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Mike F
"DJ" wrote in message
...
I'm working with a series of macros (Excel 2003) that schedule hourly
updates
of a bunch of web queries, and then process each hour's query results.
The
scheduling macro calls up the refresh and processing macros.

I have been using Application.DisplayAlerts = False in the beginning of
both
the scheduling macro, and the refresh macro. None of the referenced
macros
include Application.DisplayAlerts = True. However, when one of the
queried
websites cannot be opened, a pop-up box states:

"Unable to open http://[web address]. Cannot download information you
requested."

This box stops the macros from continuing until it is clicked by a person.
How can I stop alerts that occur during web query refreshes? Some of the
code I'm using follows:

Sub SetSchedule ()
Application.DisplayAlerts = False
Sheets("Data").Select
Range("g5:z5").Select
For Each Item in Selection
Application.OnTime Item.Value, "Refresh"
Application.OnTime Item.Value + TimeValue("00:10:00"), "Macro3"
Application.OnTime Item.Value + TimeValue("00:11:00"), "Macro4"
Next Item
End Sub

Sub Refresh ()
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Sub Macro5 ()
Application.ScreenUpdating = True
Application.StatusBar = "Scheduled Updates are Running"
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
dj dj is offline
external usenet poster
 
Posts: 92
Default Refreshing Web Queries and DisplayAlerts

Thanks, I'll give it a try . . .

"Mike Fogleman" wrote:

Try this:
Sub Refresh ()
On Error Resume Next
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Mike F
"DJ" wrote in message
...
I'm working with a series of macros (Excel 2003) that schedule hourly
updates
of a bunch of web queries, and then process each hour's query results.
The
scheduling macro calls up the refresh and processing macros.

I have been using Application.DisplayAlerts = False in the beginning of
both
the scheduling macro, and the refresh macro. None of the referenced
macros
include Application.DisplayAlerts = True. However, when one of the
queried
websites cannot be opened, a pop-up box states:

"Unable to open http://[web address]. Cannot download information you
requested."

This box stops the macros from continuing until it is clicked by a person.
How can I stop alerts that occur during web query refreshes? Some of the
code I'm using follows:

Sub SetSchedule ()
Application.DisplayAlerts = False
Sheets("Data").Select
Range("g5:z5").Select
For Each Item in Selection
Application.OnTime Item.Value, "Refresh"
Application.OnTime Item.Value + TimeValue("00:10:00"), "Macro3"
Application.OnTime Item.Value + TimeValue("00:11:00"), "Macro4"
Next Item
End Sub

Sub Refresh ()
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Sub Macro5 ()
Application.ScreenUpdating = True
Application.StatusBar = "Scheduled Updates are Running"
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
dj dj is offline
external usenet poster
 
Posts: 92
Default Refreshing Web Queries and DisplayAlerts

Hi Mike,
On Error Resume Next does not prevent web query pop-up windows when a site
is not available.

Any other ideas?


"Mike Fogleman" wrote:

Try this:
Sub Refresh ()
On Error Resume Next
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Mike F
"DJ" wrote in message
...
I'm working with a series of macros (Excel 2003) that schedule hourly
updates
of a bunch of web queries, and then process each hour's query results.
The
scheduling macro calls up the refresh and processing macros.

I have been using Application.DisplayAlerts = False in the beginning of
both
the scheduling macro, and the refresh macro. None of the referenced
macros
include Application.DisplayAlerts = True. However, when one of the
queried
websites cannot be opened, a pop-up box states:

"Unable to open http://[web address]. Cannot download information you
requested."

This box stops the macros from continuing until it is clicked by a person.
How can I stop alerts that occur during web query refreshes? Some of the
code I'm using follows:

Sub SetSchedule ()
Application.DisplayAlerts = False
Sheets("Data").Select
Range("g5:z5").Select
For Each Item in Selection
Application.OnTime Item.Value, "Refresh"
Application.OnTime Item.Value + TimeValue("00:10:00"), "Macro3"
Application.OnTime Item.Value + TimeValue("00:11:00"), "Macro4"
Next Item
End Sub

Sub Refresh ()
Windows("filename.xls").Activate
Application.StatusBar = "Processing Refresh"
Application.DisplayAlerts = False
Sheets("Data").Select
Range("c3").Select
ActiveCell = Now()
Application.ScreenUpdating = False
ActiveWorkbook.RefreshAll
Application.OnTime Now + TimeValue("00:02:30"), "Macro5"
End Sub

Sub Macro5 ()
Application.ScreenUpdating = True
Application.StatusBar = "Scheduled Updates are Running"
End Sub




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
refreshing web queries ezil Excel Programming 1 June 17th 07 08:33 PM
DisplayAlerts Gary''s Student Excel Programming 0 April 9th 07 06:40 PM
Problems refreshing internal queries in excel mjzoltan Excel Discussion (Misc queries) 0 January 12th 06 08:58 PM
DisplayAlerts (Which Ones?) Klatuu Excel Programming 2 June 30th 05 02:09 PM
DisplayAlerts Howard Kaikow Excel Programming 12 April 29th 05 04:24 PM


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