DoCmd.SetWarnings - In Excel instead of Access

mab9

New Member
Joined
Apr 11, 2006
Messages
31
Hi,

I've used the DoCmd.SetWarnings = FALSE command in Access to prevent error messages from popping up & I'd like to do the same in Excel. Is there a simliar code line for this?

Thanks!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Perhaps this at the start of the code.
Code:
Application.DisplayAlerts = False
And this at the end.
Code:
Application.DisplayAlerts = True
By the way DoCmd.SetWarnings isn't for preventing error messages, it's to suppress the messages you get when say running an update query.
 
Upvote 0
I already have the display alerts as false at the start.

Regarding DoCmd, thats probably right. I was using it to prevent an append query error msg from showing up.

The issue I'm trying to get here is there is some code that was written in Excel2003, but some users are still on 2000. The crux of the program works, except for 1 piece and I'd rather the code not pop up all kinds of errors when it gets to that point.
 
Upvote 0
If it really is an error message you want to suppress then you should probably try and eliminate the error.

You could do that 2 ways.

1 Fix the code so it doesn't error.

2 Use error handling eg On Error Resume Next.

Personally I would recommend option 1.
 
Upvote 0
Well in this case, its not an error, its Excel2000 not recognizing one line of code that is being used on the 2003 machines.

I'll try the 2nd
 
Upvote 0
Well that sounds like an error to me.:)

Can you post the offending code?

By the way if you are developing code that will be distributed across mutltiple versions you should probably do it in the earliest version to avoid compatibility issues.
 
Upvote 0
The offending code to XL2000 is

Code:
     ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
        True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
        AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True

It protects a specific range from data changes/columns deletion but allows for formatting. This feature isn't available in 2000. I didn't realize until this morning that some people were still on old versions which is wy this hadn't come up.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top