This code is more complex than necessary to do what you describe. It isn't necessary to change all those Application attributes to be able to save a file; the action won't trigger alerts, screen updating, calculation, or events. Also I don't see why you show the user a dialog box to save the file when you already know what name you want to use. That will allow the user to save it with any name, in any folder. If that's what you intend to do, you can use your original line of code for that.
I would suggest the following, which I have tested:
I just gave this a second thought--do you have a BeforeSave or AfterSave event handler? In that case you may want to turn off events, but it all depends on what the handler does and whether you want to disable it for this particular save.
Bookmarks