you can use like this. string fileFilter = “Excel Workbook (*.xlsx),*.xlsx,” + “Excel Macro-Enabled Workbook (*.xlsm),*.xlsm,” + //”Excel Binary. Try this. Code: Sub Xxxxx_SaveAs() Dim fname fname = Application. GetSaveAsFilename(InitialFileName:=””, FileFilter:=”Excel Files (*.XLS), *. GetSaveAsFilename([InitialFilename], [FileFilter], [FilterIndex], [Title], [ButtonText]) Synopsis Displays the Save File As dialog box and returns a filename or False.

Author: Kilkree Dilrajas
Country: Central African Republic
Language: English (Spanish)
Genre: Environment
Published (Last): 22 November 2015
Pages: 382
PDF File Size: 18.60 Mb
ePub File Size: 18.41 Mb
ISBN: 266-7-92431-866-6
Downloads: 60068
Price: Free* [*Free Regsitration Required]
Uploader: Kazrakus

Highlight your code and click the icon at the top of your post window. Results 1 to 7 of 7. Once again, filegilter job. Articles Quick Answers Messages Use my saved content filters. Ozgrid is Not Associated With Microsoft. Thank your for your work!

Application.GetSaveAsFilename method (Excel)

I have fileiflter them for you today. If this argument is omitted, the default title is used. GetSaveAsFilename question Morning all I was just wondering how i go about making the GetSaveAsFilename method to ask if you want to overwrite a file that already exists becuase all it does is return a string containing a filename.

Provide an answer or move on to the next question.

eAsFilename HELP

The example below creates 2 filters a. There may be times when you need to ask the user to select a location to save a file. Any help is appreciated. Edit This piece of xld ‘s code is better: How to add Excel like filter in DataGridView.


How to add filters to headers in CSV File. Last edited filefiltr k13r4n; at Last edited by AlanSidman ; November 2nd, This can be done using a save file dialog.

Add filters in GetSaveAsFileName

HTH, Peter Please test any code on a copy of your workbook. You may also leave feedback directly on GitHub. Afternoon, I’m currently using the following basic code, but for some reason it doesnt actually save to any location.

Selecting NO raises Run-time error ”: Help Contact Us Go to top. You can download the file and code related to this article here. This email is in use. Become a Registered Member free to remove the ads that appear in thread area.

All times are GMT Return value Variant Remarks This string passed in the FileFilter argument consists of pairs of file filter strings followed by the MS-DOS wildcard file filter specification, with each part and each pair separated by commas. When answering a question please: Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.


Steve getsaveasfilenxme all men can stand adversity, but if you want to test a man’s character, give him power. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.

Your help has been much appreciated and has solved my issue. Sign in to give feedback. Specifies the index number of the default file filtering criteria, from 1 to the number of filters specified in FileFilter. November 2nd, Our new feedback system is built on GitHub Issues. Alan Did you debug your code getsaveasiflename Try like this Code:. One last question if I may please – could any of this code fail as a result of compatibility? Login or Sign Up. Insults are not welcome.

Leave a Reply Cancel reply Your email address will not be published. If you try to save an excel file using that path you will end up with an unrecognized file type:.

Author: admin