Save File As

Save File As

[vb autolinks=”false” classname=”myclass” collapse=”false” firstline=”1″ gutter=”true” highlight=”” htmlscript=”false” light=”false” padlinenumbers=”false” smarttabs=”true” tabsize=”4″ toolbar=”true” title=”Save As”]
Private Sub FileSaveAs()
‘Opens a File Save As window and offers an XLSX openXML format type
Dim fName As Variant

fName = Application.GetSaveAsFilename( _
FileFilter:="Excel Workbooks (*.xlsx), *.xlsx")

If fName = "" Then ‘ user Canceled
Exit Sub
End If

On Error Resume Next
ActiveWorkbook.SaveAs FileName:=fName, _
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
If Err <> 0 Then
‘user cancelled
Err.Clear
End If
On Error GoTo 0 ‘ clear error trapping

End Sub
[/vb]