SaveAs dialog argument for file type

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.
 
G

goshute

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top