How to avoid warning pop-up dialog boxes

A

Andrew

Hello,
I have a purchase order template which has a bunch on vendor
information on sheet 2, while the actual purchase order form is on
sheet 1. I have a button on screen which is called "create PO". When
I press this button, the program re-names the worksheet as PO-
(addnumber), and then deletes the second sheet, which contains all of
the vendor information. So, when the program tries to delete sheet 2,
it sends a pop up dialog which requires the user to press OK or
Cancel. How can I have the program skip this pop up box?

thanks
 
K

Kevin B

Using the following line of code at the top of the sub/function that deletes
the sheet:

Application.DisplayAlerts = False
 
M

Mike H

try

Application.displayalerts=false
your code to delete sheet
Application.displayalerts=True

Mike
 

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

Top