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

Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002? Is
there a solution?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Display alerts error

Presumably your UDF SheetExists is causing the problem - post this code for
diagnosis.

--
Cheers
Nigel



"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002? Is
there a solution?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Display alerts error

I don't see how as the error is specific to the Application object. Here is
the code


Function SheetExists(ByVal sName As String) As Boolean
On Error GoTo not_found
Sheets(sName).Select
SheetExists = True
Exit Function
not_found:
SheetExists = False
End Function


"Nigel" wrote:

Presumably your UDF SheetExists is causing the problem - post this code for
diagnosis.

--
Cheers
Nigel



"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002? Is
there a solution?




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

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002? Is
there a solution?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Display alerts error

Yes, it is executed within Excel and written in VBA. It is executed when the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002? Is
there a solution?






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

I would remove the selection from the SheetsExists routine.

Function SheetExists(ByVal sName As String) As Boolean
Dim sh as Object
On Error GoTo not_found
set sh = Sheets(sName)
SheetExists = True
Exit Function
not_found:
SheetExists = False
End Function

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Yes, it is executed within Excel and written in VBA. It is executed when

the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported

the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002?

Is
there a solution?






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display alerts error

Nothing in the code that shouldn't work in Excel 2002. I assume the code
isn't in the sheet module for Sheet3.

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Yes, it is executed within Excel and written in VBA. It is executed when

the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported

the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002?

Is
there a solution?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display alerts error

this was a false start reply I was trying to delete and hit the send button
by mistake. Please ignore.

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Nothing in the code that shouldn't work in Excel 2002. I assume the code
isn't in the sheet module for Sheet3.

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Yes, it is executed within Excel and written in VBA. It is executed

when
the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel

and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has

reported
the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in

2002?
Is
there a solution?







  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Display alerts error

I didn't either but since there was no other source of any error I just felt
seeing this might help - as I see it is very strange indeed.

Cannot offer a solution - sorry

--
Cheers
Nigel



"AWSD" wrote in message
...
I don't see how as the error is specific to the Application object. Here

is
the code


Function SheetExists(ByVal sName As String) As Boolean
On Error GoTo not_found
Sheets(sName).Select
SheetExists = True
Exit Function
not_found:
SheetExists = False
End Function


"Nigel" wrote:

Presumably your UDF SheetExists is causing the problem - post this code

for
diagnosis.

--
Cheers
Nigel



"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported

the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002?

Is
there a solution?






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Display alerts error

Thanks, I'll give it a go.

"Tom Ogilvy" wrote:

I would remove the selection from the SheetsExists routine.

Function SheetExists(ByVal sName As String) As Boolean
Dim sh as Object
On Error GoTo not_found
set sh = Sheets(sName)
SheetExists = True
Exit Function
not_found:
SheetExists = False
End Function

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Yes, it is executed within Excel and written in VBA. It is executed when

the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported

the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002?

Is
there a solution?








  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Display alerts error

No, the code is not in a sheet module.

"Tom Ogilvy" wrote:

Nothing in the code that shouldn't work in Excel 2002. I assume the code
isn't in the sheet module for Sheet3.

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Yes, it is executed within Excel and written in VBA. It is executed when

the
user clicks a button.

"Tom Ogilvy" wrote:

That is a peculiar error. Is this code being executed within Excel and
written in VBA?

--
Regards,
Tom Ogilvy


"AWSD" wrote in message
...
Hi,

Within a Sub I have the following code fragment:

Application.ScreenUpdating = False
Application.DisplayAlerts = False
If SheetExists("Sheet3") Then Sheets("Sheet3").Delete
Application.DisplayAlerts = True

This works fine in Excel 2000 but a user using Excel 2002 has reported

the
following error:

Method "display Alerts" of object '_Application' failed.

I cant see why the error is being raised. Is there a problem in 2002?

Is
there a solution?






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
Display Alerts MarkN Excel Discussion (Misc queries) 0 June 8th 06 03:13 AM
Stopping Display Alerts Mark Excel Programming 1 February 8th 05 02:01 PM
Display Alerts Earl[_4_] Excel Programming 2 August 12th 04 08:18 PM
Display Alerts Valerie[_2_] Excel Programming 1 September 8th 03 09:43 PM
Code to not display delete sheet alerts John[_46_] Excel Programming 2 August 25th 03 01:44 PM


All times are GMT +1. The time now is 03:57 PM.

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"