How can I make the save as box pop up with code


Posted by steve w on July 31, 2001 10:24 AM

How can I make the save as box pop up with code.
I want it to pop up after a command button is clicked
thanks a bunch
steve w

Posted by cpod on July 31, 2001 11:49 AM

Application.Dialogs(xlDialogSaveAs).Show

Posted by Jerid on July 31, 2001 11:55 AM

Steve, try this.

Sub SaveBook()
Dim vFileName As Variant

vFileName = Application.GetSaveAsFilename

If vFileName = False Then
MsgBox "Name not specified" & vbCrLf & "File Not Saved", vbOKOnly, "Save File"
Exit Sub
Else
Application.ActiveWorkbook.SaveAs vFileName & ".xls", xlWorkbookNormal
End If
End Sub

Jerid



Posted by John on August 01, 2001 9:45 AM

That's nice and clean.

Is there a way to have another macro continue after
the file is saved? I want to have a workbook sent
as e-mail, via outlook, and would like to have
this happen automatically after the file is saved.