View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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?