ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message box warns for duplicate use of named ranges when copying s (https://www.excelbanter.com/excel-programming/441484-message-box-warns-duplicate-use-named-ranges-when-copying-s.html)

nb0512

Message box warns for duplicate use of named ranges when copying s
 
I created an Exel/VBA2003 application in which a copy of a worksheet is added
when the user pushes some button on the main form. In the worksheet which is
copied, I use a few named ranges. This works fine in 2003.
In 2007, however, a message box pops up that warns for duplicate use of the
named range in the new sheet. Since there are 5 ranges, it is quite annoying
to cancel these message boxes every time.

Can I programmatically prevent these msg boxes from popping up ?

Thanks !

nb0512

Message box warns for duplicate use of named ranges when copying s
 
Found one answer on pcreview (gracias a Hector Miguel): add
Application.DisplayAlerts = False at the beginning of the sub and
Application.DisplayAlerts =True just before the end
This will stop the application from bothering you with any unwanted message
boxes

nb0512

"nb0512" wrote:

I created an Exel/VBA2003 application in which a copy of a worksheet is added
when the user pushes some button on the main form. In the worksheet which is
copied, I use a few named ranges. This works fine in 2003.
In 2007, however, a message box pops up that warns for duplicate use of the
named range in the new sheet. Since there are 5 ranges, it is quite annoying
to cancel these message boxes every time.

Can I programmatically prevent these msg boxes from popping up ?

Thanks !



All times are GMT +1. The time now is 12:04 AM.

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