Problem with Application.DisplayAlerts

  • Thread starter Thread starter mjb267
  • Start date Start date
M

mjb267

I have the following code in a subroutine in a module:

Sub display()
Application.DisplayAlerts = False
Do Until Sheets.Count = 1
ActiveSheet.Delete
If Sheets.Count = 1 Then
Exit Do
End If
Loop
Application.DisplayAlerts = True
End Sub


When i run the applicaiton on my computer, everything works fine. Whe
i try to run in through internet explorer 6.0, it give me the erro
message

run-time error 1004. method 'displayalerts' of object '_application
failed.

any ideas what the problem could be?

apprieciate any help
Thank
 
oops, that was a little vague.

the excel file is sitting on the server, when the user access the file
it can either be saved to the user's harddrive or opened. When it i
opened, it opens in internet explorer instead of excel. The applicatio
works in the excel environment, but not when its running in interne
explorer.

thank
 
I'm betting that application refers to MSIE.

Maybe you could do something like:

Option Explicit
Sub display()
ThisWorkbook.Parent.DisplayAlerts = False
Do Until ThisWorkbook.Sheets.Count = 1
ThisWorkbook.ActiveSheet.Delete
If ThisWorkbook.Sheets.Count = 1 Then
Exit Do
End If
Loop
ThisWorkbook.Parent.DisplayAlerts = True
End Sub

I'm not sure if this is feasible for you, but you may want to consider opening
the file in excel--instead of MSIE.

There's a setting in Windows that you can change.

In win98, I can do this:
Start Windows Explorer
View|Folder Options
File Types Tab
scroll down to MS Excel Worksheet
Select it
click the edit button
There's an option to "browse in same window". Uncheck it.

That's where you can toggle the "confirm open after download", too.

How to Configure Internet Explorer to Open Office
Documents in the Appropriate Office Program Instead of in Internet Explorer
http://support.microsoft.com/?scid=162059
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top