Archive of Mr Excel Message Board


Back to Errors in Excel archive index
Back to archive home

Does anyone know how to “save as” without error messages.

Posted by Andy on May 09, 2001 10:51 AM
With a macro, I am trying to open a file and then “Save as” another file.
I have mastered this step but I keep getting a user interface box telling me the file already exists.
I know it does! I created it a few hours ago.
Is there any way of suppressing the error box whilst running the macro; so that no user input is required, apart from setting the macro in operation.

Thanks
Andy


Re: Does anyone know how to “save as” without error messages.

Posted by Dave Hawley on May 09, 2001 10:53 AM


Hi Andy

There sure is, use:

Sub YourMacro()
Application.DisplayAlerts=False
'Your code
Application.DisplayAlerts=True
End sub

Dave

OzGrid Business Applications


Re: Does anyone know how to “save as” without error messages.

Posted by Andy on May 09, 2001 11:00 AM
Thanks Dave, off down the Pub now, I'll have a beer for you!

Cheers mate!!


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.