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

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



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!!