SaveAs dialog argument for file type

  • Thread starter Thread starter Zahir
  • Start date Start date
Z

Zahir

I wrote a macro by which I want the user to save the file with an extension
of *.xlt, I mean as a template. I don't how to show the template format in
the type box of SaveAs dialog. Can anybody help me.
 
See if this will work for you:

Sub SelectSaveFileName()
Dim TheFile As Variant
TheFile = Application.GetSaveAsFilename("C:\Temp\File.xlt", "Template
(*.xlt), *.xlt", , "Your choice:")
If TheFile = False Then
MsgBox "You cancelled"
Else
MsgBox "Do something with file " & CStr(TheFile)
End If
End Sub

Goshute
 
Back
Top