Suppressing popups

  • Thread starter David Langschied
  • Start date
D

David Langschied

I have a piece of code that takes a portion of a worksheet copies it to
another worksheet, deletes the previous worksheet, copies the new worksheet
to the OS as a CSV file, then resaves the whole workbook. It all works very
well, but ...

I would like not to have the user interact with this process. The trouble
is that excel does two things:

warns the user that the deletion of the sheet could result in data loss (OK
or Cancel required)
asks the user if he/she wants to over write the existing workbook on the OS
(yes or No required)

How can I suppress these popups by telling Excel the answers for the user
(OK and Yes)?
 
B

Bob Greenblatt

I have a piece of code that takes a portion of a worksheet copies it to
another worksheet, deletes the previous worksheet, copies the new worksheet
to the OS as a CSV file, then resaves the whole workbook. It all works very
well, but ...

I would like not to have the user interact with this process. The trouble
is that excel does two things:

warns the user that the deletion of the sheet could result in data loss (OK
or Cancel required)
asks the user if he/she wants to over write the existing workbook on the OS
(yes or No required)

How can I suppress these popups by telling Excel the answers for the user
(OK and Yes)?
I assume you are using Excel 204 and VBA. If so, then just add
application.displayalerts=false to turn off the dialogs.
 
D

David Langschied

That did the trick!

Bob Greenblatt said:
I assume you are using Excel 204 and VBA. If so, then just add
application.displayalerts=false to turn off the dialogs.
 

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