ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to set file Filter in Save dialog box (https://www.excelbanter.com/excel-programming/368806-how-set-file-filter-save-dialog-box.html)

sreenath205

How to set file Filter in Save dialog box
 

Hi All

I have a button in one of my sheet,when i click on it following macro
code is invoked

Code:
--------------------


Private Sub CommandButton3_Click()
Sheets("InputFile").Select
Application.Dialogs(xlDialogSaveAs).Show
End Sub


--------------------


Question: The dialog which opens up has filters like "All
files[*.*],Test[*.txt]" etc in fileType: filetr,how to restrict this
filter to *.txt" only?

Thanks
Sreenath M


--
sreenath205
------------------------------------------------------------------------
sreenath205's Profile: http://www.excelforum.com/member.php...o&userid=35663
View this thread: http://www.excelforum.com/showthread...hreadid=566541


Harald Staff

How to set file Filter in Save dialog box
 
Hi

Try using
Application.GetSaveAsFilename
instead of that dialog, you have no control of how that one turns out. See
Help for detail.

HTH. Best wishes Harald

"sreenath205"
skrev i melding
...

Hi All

I have a button in one of my sheet,when i click on it following macro
code is invoked

Code:
--------------------


Private Sub CommandButton3_Click()
Sheets("InputFile").Select
Application.Dialogs(xlDialogSaveAs).Show
End Sub


--------------------


Question: The dialog which opens up has filters like "All
files[*.*],Test[*.txt]" etc in fileType: filetr,how to restrict this
filter to *.txt" only?

Thanks
Sreenath M


--
sreenath205
------------------------------------------------------------------------
sreenath205's Profile:

http://www.excelforum.com/member.php...o&userid=35663
View this thread: http://www.excelforum.com/showthread...hreadid=566541





All times are GMT +1. The time now is 12:13 AM.

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