Skip Override Prompt in Macro

  • Thread starter Thread starter iperlovsky
  • Start date Start date
I

iperlovsky

I have a histogram macro that I am trying to run, but I receive a prompt that
says something like "output range will overwrite existing data. Press OK to
overwrite data in range..." The window displays the "OK" button, "Cancel",
and "Help". How do I have the macro shut this off or power through this
automatically? PS: The macro runs 20 histograms sequentially.
 
Maybe

application.displayalerts = false

code to run

application.displayalerts = true


Gord Dibben MS Excel MVP
 
For a more general solution, there is always "Tools/Options.../Edit", "Alert
before overwriting cells" (uncheck the box).

Eric
 
I tried this but it did not work. Maybe it has to do with the alert type:
overwrite existing cells. Any ideas? Here is some of the code:

Sub Histo()
Application.DisplayAlerts = False
Application.Run "ATPVBAEN.XLA!Histogram", ActiveSheet.Range("_01"),
ActiveSheet.Range("$FV$34"), _ , False, False, False, False
Application.Run "ATPVBAEN.XLA!Histogram", ActiveSheet.Range("_02"),
ActiveSheet.Range("$FX$34"), _ , False, False, False, False
Application.DisplayAlerts = True
End Sub
 
Back
Top