ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Skip Override Prompt in Macro (https://www.excelbanter.com/excel-programming/430374-skip-override-prompt-macro.html)

iperlovsky

Skip Override Prompt in Macro
 

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.

Gord Dibben

Skip Override Prompt in Macro
 

Maybe

application.displayalerts = false

code to run

application.displayalerts = true


Gord Dibben MS Excel MVP

On Thu, 25 Jun 2009 13:20:02 -0700, iperlovsky
wrote:

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.



EricG

Skip Override Prompt in Macro
 

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

Eric

"iperlovsky" wrote:

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.


iperlovsky

Skip Override Prompt in Macro
 

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


"Gord Dibben" wrote:

Maybe

application.displayalerts = false

code to run

application.displayalerts = true


Gord Dibben MS Excel MVP

On Thu, 25 Jun 2009 13:20:02 -0700, iperlovsky
wrote:

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.





All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com