I have a .xltm template that is a form used by several users. After the user enters some information (Co, MASitem, MASdesc) the form is ready to be saved. There is a button that launches the code below. Right now it successfully opens the saveas dialog and fills in the file name and .xlsm extension correctly. When save is clicked the window closes, but nothing is saved! Obviously I'm missing something... help please!

- Ian

Sub SaveAs()

Dim Var As Variant
Dim BuildFileName As String
Dim FilePath As String
Dim MASitem As String
Dim NEWitem As String
Dim MASdesc As String
Dim NEWdesc As String
Dim Co As String

If Cells(2, 20).Value <> "" Then
    Co = "AB, "
    ElseIf Cells(2, 23).Value <> "" Then
    Co = "CD, "
    ElseIf Cells(2, 26).Value <> "" Then
    Co = "EF, "
    Else: MsgBox "Select a Company Name first."
    End
End If
    
MASitem = Cells(4, 14).Value
If MASitem = "" Then
    MsgBox "The Item Code field is blank."
    End
Else
    NEWitem = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(MASitem, "|", "-"), ">", "-"), "<", "-"), Chr(34), "in"), "?", ""), "*", ""), ":", "-"), "/", "_"), "\", "_"), ", ", " "), ",", " ")
End If

MASdesc = Cells(6, 14).Value
If MASdesc = "" Then
    MsgBox "The Description field is blank. Check Item Code."
Else
    NEWdesc = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(MASdesc, "|", "-"), ">", "-"), "<", "-"), Chr(34), "in"), "?", ""), "*", ""), ":", "-"), "/", "_"), "\", "_"), ", ", " "), ",", " ")
End If

FilePath = "C:\folder\"
BuildFileName = FilePath & Co & NEWitem & ", MAP-ACE " & NEWdesc
Var = Application.GetSaveAsFilename(BuildFileName, fileFilter:="Excel Files (*.xlsm), *.xlsm")
Application.DisplayAlerts = True

End Sub