If you are only looking for the line of code that displays the Save As box, it is:
Application.Dialogs(xlDialogSaveAs).Show
If you are looking for something additionally, please repost.
HTH
Tom Urtis
Thanks! Is there a way to set the macro so that it will not allow saving over the current document?
Becky,
There are a couple different ways you can go with that, but I'm not sure how you are organizing the entire task. Bringing up the Saved As dialog box as you first posted would suggest to me that you likely want the user to manually choose from that point what and where to name the file. If the user chooses a file name already being used in that path, Excel would automatically pop up its own message and satisfy your concern right there.
On the other hand, if this is part of other code that you are continuing past this point, you can insert Error Handling code to exit the sub with a message box that the file already exists:
On Error Goto File_Exists
ActiveSheet.SaveAs Filename:="C:\Your\File\Path\" & Whatever & ".xls"
On Error Goto 0
'Rest of your macro
Exit Sub
File_Exists:
MsgBox "File name already exists, choose another"
Again, there are other ways depending on what kind of procedure you are running and how much or little involvement you want/need from your end user.
Hope this helps.
Tom Urtis
Thanks! Is there a way to set the macro so that it will not allow saving over the current document?
Not sure if this will help, but you might try adding a new toolbar button for this command. If you go to View-Toolbars-Customize, select the Commands tab, then drag the "Save As" command to your toolbar. Next, right-click on the newly-created button to edit; then select "Change Button Image", to change the button to say, the diskette with the arrow. Don't exit the Customize toolbar dialog box yet, though. If you want to get rid of the "Save As" text description next to the button image that you've created, right-click on the button again, and select "Default Style", which will hide the text description of the button and only show the button image you've selected for this new toolbar command.
Hope that helps.
John:
Thanks! Is there a way to set the macro so that it will not allow saving over the current document?