Stopping Message boxes

dukeofscouts

Board Regular
Joined
Jan 19, 2009
Messages
146
I have to macros that I use very often, both of these codes cause excel to display message boxes to be displayed. One is from a SAVE command, the other from a copy/paste command structure.

I presume there is a way to turn these messages off, or write into the VBA to trick excel into thinking that I clicked "OK". Could you please give me some insight?

Thank you in advance,
D.O.S.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Could you please give me some insight?
Sure...but first can you please give us some code?

If you post your code, you can get a response suggestion germane to your existing situation. Not clear if you are using a BeforeSave event, or change events, or independent macros, or what.
 
Upvote 0
I agree with Tom that you need to post some code, but one thing you can use is:

Application.DisplayAlerts = False

at the beginning of your code (remembering to set it back to True at the end, because Excel won't).

Note that will suppress all messages, hence Tom's request to see your code.

HTH,
 
Upvote 0
1)
...
chdir "C:\users\user\documents\homefiles"
Activeworkbook.saveas Filename:= _
"c:\users\user\documents\home files\Planning.xlsm", fileformat:= _
xlopenxmlworkbookmacroenabled, createbackup:=False
...

2)
range("b31:ab57").select
selection.copy
range("b2:d4").select
selection.PasteSpecial Paste: xlPastevalues, operation:=xlnone, skipblanks _
:=False, Transpose:= False
 
Upvote 0
Note that you can lose the chdir part - It doesn't do anything in your case, and you can eliminate the select statements:

Code:
Range("B31:AB57").Copy
    Range("B2").PasteSpecial xlPasteValues
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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