Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to clear error

Hi,

I have a simple macro or two, that this group has helped me write (thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data is
pointing, is out of service. If during that time, refresh is executed, I get
a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line while
the box is waiting for me to click OK. If I am not at my desk to click OK,
then my data which I am logging, is interrupted for however long I am
away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready... and pole
again, and again, on its regular interval... because, the server usually
returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a reply.
Working with Excel2000.

Thanks!

John


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to clear error

Gezz.. it happened while I was drafting this email... but now, since I am
using a macro to guide the refresh interval, rather than getting the prompt
box as usual, I get a macro Run-time error '1004' because the web query was
not on-line...

Is there an associated macro command to deal with this?

John
"gifer" wrote in message
...
Hi,

I have a simple macro or two, that this group has helped me write (thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data is
pointing, is out of service. If during that time, refresh is executed, I
get a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line
while the box is waiting for me to click OK. If I am not at my desk to
click OK, then my data which I am logging, is interrupted for however long
I am away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready... and
pole again, and again, on its regular interval... because, the server
usually returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a reply.
Working with Excel2000.

Thanks!

John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Macro to clear error

Although I do not know what the code you are using looks like, one technique
that I use is a conditional loop that evaluates the error code produced by
the macro you are using.

A simple example is:

on error resume next 'tells excel to ignore errors

refresh commands

do while err=1004
repeat refresh commands
end

The error is the event.


"gifer" wrote:

Hi,

I have a simple macro or two, that this group has helped me write (thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data is
pointing, is out of service. If during that time, refresh is executed, I get
a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line while
the box is waiting for me to click OK. If I am not at my desk to click OK,
then my data which I am logging, is interrupted for however long I am
away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready... and pole
again, and again, on its regular interval... because, the server usually
returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a reply.
Working with Excel2000.

Thanks!

John



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to clear error

On Error Resume Next

possibly.

--
Regards,
Tom Ogilvy

"gifer" wrote in message
...
Gezz.. it happened while I was drafting this email... but now, since I am
using a macro to guide the refresh interval, rather than getting the

prompt
box as usual, I get a macro Run-time error '1004' because the web query

was
not on-line...

Is there an associated macro command to deal with this?

John
"gifer" wrote in message
...
Hi,

I have a simple macro or two, that this group has helped me write (thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data

is
pointing, is out of service. If during that time, refresh is executed, I
get a box telling me that "update/refresh is unable to query server"...

It
requires acknowledgment, even though the server may come back on line
while the box is waiting for me to click OK. If I am not at my desk to
click OK, then my data which I am logging, is interrupted for however

long
I am away... which could be while I am at home, off for the weekend,

etc.

How can I have the macro ignore that the server may not be ready... and
pole again, and again, on its regular interval... because, the server
usually returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a

reply.
Working with Excel2000.

Thanks!

John





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to clear error

Thanks. I tried a couple things, but compile error expecting End or End
Sub... couldn't get it to compile w/o error. My original code is below...
I'm not sure where to insert the resume on error... would it be after the
line that fails; noted below in SaveMacro. The first two sets of code are
to have the SaveMacro run every 5 seconds. Those parts work fine.

Public RunWhen As Double
Public Const cRunIntervalSeconds = 5
Public Const cRunWhat = "SaveMacro"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat,
schedule:=True
End Sub


Sub SaveMacro()
'
' SaveMacro Macro
' Macro recorded 3/8/2005 by john
'

'
ActiveWorkbook.Save

ActiveWorkbook.RefreshAll (This is where I get the Run-Time error 1004).


End Sub



"Chad" wrote in message
...
Although I do not know what the code you are using looks like, one
technique
that I use is a conditional loop that evaluates the error code produced by
the macro you are using.

A simple example is:

on error resume next 'tells excel to ignore errors

refresh commands

do while err=1004
repeat refresh commands
end

The error is the event.


"gifer" wrote:

Hi,

I have a simple macro or two, that this group has helped me write (thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data is
pointing, is out of service. If during that time, refresh is executed, I
get
a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line
while
the box is waiting for me to click OK. If I am not at my desk to click
OK,
then my data which I am logging, is interrupted for however long I am
away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready... and
pole
again, and again, on its regular interval... because, the server usually
returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a reply.
Working with Excel2000.

Thanks!

John







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to clear error

Sub SaveMacro()
'
' SaveMacro Macro
' Macro recorded 3/8/2005 by john
'

'

ActiveWorkbook.Save
On Error Resume Next
ActiveWorkbook.RefreshAll ' (This is where I get the Run-Time error
1004).


End Sub

--
Regards,
Tom Ogilvy


"gifer" wrote in message
...
Thanks. I tried a couple things, but compile error expecting End or End
Sub... couldn't get it to compile w/o error. My original code is below...
I'm not sure where to insert the resume on error... would it be after the
line that fails; noted below in SaveMacro. The first two sets of code are
to have the SaveMacro run every 5 seconds. Those parts work fine.

Public RunWhen As Double
Public Const cRunIntervalSeconds = 5
Public Const cRunWhat = "SaveMacro"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat,
schedule:=True
End Sub


Sub SaveMacro()
'
' SaveMacro Macro
' Macro recorded 3/8/2005 by john
'

'
ActiveWorkbook.Save

ActiveWorkbook.RefreshAll (This is where I get the Run-Time error

1004).


End Sub



"Chad" wrote in message
...
Although I do not know what the code you are using looks like, one
technique
that I use is a conditional loop that evaluates the error code produced

by
the macro you are using.

A simple example is:

on error resume next 'tells excel to ignore errors

refresh commands

do while err=1004
repeat refresh commands
end

The error is the event.


"gifer" wrote:

Hi,

I have a simple macro or two, that this group has helped me write

(thank
you), that tells my worksheet to RefreshAll, so outside data is updated
every 30 seconds. Occasionally, the server where the Get External Data

is
pointing, is out of service. If during that time, refresh is executed,

I
get
a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line
while
the box is waiting for me to click OK. If I am not at my desk to click
OK,
then my data which I am logging, is interrupted for however long I am
away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready... and
pole
again, and again, on its regular interval... because, the server

usually
returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a

reply.
Working with Excel2000.

Thanks!

John







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Macro to clear error

Thanks... I just tried something before I checked for new replies... same
thing you did! Yeah.

John
"Tom Ogilvy" wrote in message
...
Sub SaveMacro()
'
' SaveMacro Macro
' Macro recorded 3/8/2005 by john
'

'

ActiveWorkbook.Save
On Error Resume Next
ActiveWorkbook.RefreshAll ' (This is where I get the Run-Time error
1004).


End Sub

--
Regards,
Tom Ogilvy


"gifer" wrote in message
...
Thanks. I tried a couple things, but compile error expecting End or End
Sub... couldn't get it to compile w/o error. My original code is below...
I'm not sure where to insert the resume on error... would it be after the
line that fails; noted below in SaveMacro. The first two sets of code
are
to have the SaveMacro run every 5 seconds. Those parts work fine.

Public RunWhen As Double
Public Const cRunIntervalSeconds = 5
Public Const cRunWhat = "SaveMacro"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat,
schedule:=True
End Sub


Sub SaveMacro()
'
' SaveMacro Macro
' Macro recorded 3/8/2005 by john
'

'
ActiveWorkbook.Save

ActiveWorkbook.RefreshAll (This is where I get the Run-Time error

1004).


End Sub



"Chad" wrote in message
...
Although I do not know what the code you are using looks like, one
technique
that I use is a conditional loop that evaluates the error code produced

by
the macro you are using.

A simple example is:

on error resume next 'tells excel to ignore errors

refresh commands

do while err=1004
repeat refresh commands
end

The error is the event.


"gifer" wrote:

Hi,

I have a simple macro or two, that this group has helped me write

(thank
you), that tells my worksheet to RefreshAll, so outside data is
updated
every 30 seconds. Occasionally, the server where the Get External Data

is
pointing, is out of service. If during that time, refresh is executed,

I
get
a box telling me that "update/refresh is unable to query server"... It
requires acknowledgment, even though the server may come back on line
while
the box is waiting for me to click OK. If I am not at my desk to click
OK,
then my data which I am logging, is interrupted for however long I am
away... which could be while I am at home, off for the weekend, etc.

How can I have the macro ignore that the server may not be ready...
and
pole
again, and again, on its regular interval... because, the server

usually
returns to service less than a 5 minutes?

I'm guessing some kind of event... I'll try while I'm waiting on a

reply.
Working with Excel2000.

Thanks!

John









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
Clear Contents Of Cell If Value = 0 or Error carl Excel Worksheet Functions 4 July 9th 07 04:54 PM
macro to clear cells press313 Excel Discussion (Misc queries) 0 May 24th 06 02:31 AM
Clear Contents Macro SJC Excel Worksheet Functions 3 October 27th 05 07:26 PM
clear data in a macro Sharon[_3_] Excel Programming 0 July 24th 03 12:36 AM
macro to clear rows Peter H Excel Programming 6 July 23rd 03 08:50 PM


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