PDA

View Full Version : Create "Save As" button on UserForm



Saladsamurai
01-01-2011, 03:06 PM
Hey folks :hi:

I need to find out what code I need to enter in a CommandButton_click routine in order to bring up the standard save as window that allows a user to browse for the folder they want to save in as well as a field to enter the name of the file.

Anyone know what method I should be looking for? The pseudocode below shows what i would like to do


Sub SaveAsPath()

Dim SaveAsPath As String

SaveAsPath = window should open here to allow user to name file and browse for folder


End Sub

Saladsamurai
01-01-2011, 03:14 PM
This seems to do the trick!

Sub SaveAsDialog()


sFileName = Application.GetSaveAsFilename

MsgBox sFileName


End Sub

mikerickson
01-01-2011, 06:16 PM
Private Sub CommandButton1_Click()
Dim didSave As Boolean
Me.Hide
didSave = Application.Dialogs(xlDialogSaveAs).Show
Me.Show
End SubThis will return True/False if the user saved.