disable warning messages?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have written a few macro's recently that take the output from Access
queries and copy the data into template spreadsheets. Depending on how large
a block of data is copied the user might get a warning about keeping the data
available to other applications on the clipboard...also get a warning when
the macro deletes some sheets from the workbook.

In Access I can turn these sorts of warnings on an off. Is there a similar
way to prevent these "breakpoints" where the user has to input a choice?

TIA
 
Yep!

Application.DisplayAlerts = False

....your code

Application.DisplayAlerts = True

This will only disable workbook-related dialogs (Save / Discard, etc).
Errordialogs generated because of misprogramming etc require a more
solid error handling. Try googling "error handling syntax vba"
Manual Man
 
Hi,

Had some problems posting this one, hope there aren't 2 answers. This
does the trick

Sub something()
Application.DisplayAlerts = False
-- some code
Application.DisplayAlerts = True
End Sub

Note: This will only prevent the usual Excel dialogs from appearing.
Error dialogs generated from VBA because of misprogramming should be
catched by more solid error handling (try "error handling syntax vba"
on google)

Regards,
ManualMan
 

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

Back
Top