Skip to content

Instantly share code, notes, and snippets.

@kissmygritts
Last active August 29, 2015 14:16
Show Gist options
  • Save kissmygritts/01a96e40aa5b5939b0e8 to your computer and use it in GitHub Desktop.
Save kissmygritts/01a96e40aa5b5939b0e8 to your computer and use it in GitHub Desktop.
Select a file with the Microsoft file dialog. Requires reference to Microsoft Object Library x.x, where x.x is the version number.
Function SaveExportAs(title As String, extension As String) As String
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogSaveAs)
With dlg
.title = title
.InitialFileName = "C:\docs\" & extension
If .Show = True Then
SaveExportAs = .SelectedItems(1)
End If
End With
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment