Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'If file is a .xlt, display Save As dialog window. Default save with the same name and folder, only with .xls extension
On Error GoTo ErrorSub
Dim strFilename As String
Application.EnableEvents = False
strFilename = ActiveWorkbook.Name
If LCase(Right(strFilename, 3)) <> "xlt" Then
Application.EnableEvents = True
Exit Sub
End If
strFilename = ActiveWorkbook.Path & Application.PathSeparator & Left(strFilename, Len(strFilename) - 3) & "xls"
strFilename = Application.GetSaveAsFilename(strFilename, "Excel Workbook (*.xls), *.xls")
If LCase(strFilename) <> "false" Then
ThisWorkbook.SaveAs (strFilename)
End If
ErrorSub:
If Err <> 0 Then
MsgBox Err.Description, vbCritical, "Error!"
End If
Application.EnableEvents = True
Cancel = True
End Sub