Suppressing Error Messages in a Macro

M

Michael D. McGill

The specific question:
Is there any way i can suppress an error message that is generated by a step
in a macro so the macro can finish.

The Details:
I have a macro that runs through windows scheduler every 15 mins that does
some table updates through an odbc connection. Occasionaly something screwy
will happen w/ the odbc connection and I get an error that a linked odbc
table does not exist. This then halts the macro and it will not run again
until someone clears the error message box. Is there any way that I can
suppress the message so the macro will complete and go ahead and run again
at its next 15 minute interval? I use the setwarnings action as the first
step in the macro but it does not suppress these odbc error messages.

Thanks in Advance,
Mike
 
K

Ken Snell [MVP]

No, a macro does not allow you to handle any errors. (SetWarnings does not
suppress error messages; it suppresses confirmation messages for changes to
data, deletions of objects, etc.)

You must use VBA code to handle errors.

Likely it's time for you to migrate from a macro to VBA code procedure to do
what you're currently doing.
 

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