ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs dialog argument for file type (https://www.excelbanter.com/excel-programming/439287-saveas-dialog-argument-file-type.html)

Zahir

SaveAs dialog argument for file type
 
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.

goshute

SaveAs dialog argument for file type
 
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


All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com