ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Turn off warnings in Macro (https://www.excelbanter.com/excel-worksheet-functions/9480-turn-off-warnings-macro.html)

Patti

Turn off warnings in Macro
 
Hi!

I have a simple Macro that runs all of the queries in my workbook. There's
a database error message that pops up for each of the queries -- it justs
requires the user to press OK to run the query. I want to turn off the
message so that all of the queries will run without any further actions by
the user. I've done something similar in Access, so I tried to use the same
code, but it's not working -- I'm getting an "Object required" run-time error.

Here's the code I'm using:

DoCmd.SetWarnings False
ActiveWorkbook.RefreshAll
DoCmd.SetWarnings True

What should I be using?

Thanks!

Ken

Patti, I use:

Application.DisplayAlerts = False


"Patti" wrote:

Hi!

I have a simple Macro that runs all of the queries in my workbook. There's
a database error message that pops up for each of the queries -- it justs
requires the user to press OK to run the query. I want to turn off the
message so that all of the queries will run without any further actions by
the user. I've done something similar in Access, so I tried to use the same
code, but it's not working -- I'm getting an "Object required" run-time error.

Here's the code I'm using:

DoCmd.SetWarnings False
ActiveWorkbook.RefreshAll
DoCmd.SetWarnings True

What should I be using?

Thanks!



All times are GMT +1. The time now is 08:35 PM.

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