Disabling messages while running a macro...

  • Thread starter Thread starter Larry B
  • Start date Start date
L

Larry B

I'm got a macro programmed that deletes a sheet in a
workbook and then saves the workbook under a different
name.

I want to run this macro as an unattended task, but every
I always get the 'are you sure you want to delete the
worksheet' and 'file exists do you want to overwrite'
message.

I always want to delete the sheet & overwrite the file.
Anyway I can disable these messages or setup the
deletesheet & saveas commands to prevent them from coming
up?
 
Larry,

Application.DisplayAlerts = False
'your saveas and delete code here
Application.DisplayAlerts = True

hth,

Doug
 
Hi
try something like:

sub foo()
'...
Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True
'..
end sub
 

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