Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel SaveAs Procedure 1

Status
Not open for further replies.

SanAntonioSpurFan

Instructor
Oct 21, 2003
83
US
I have the following Excel Procedure straight out of the Excel OnLine Help Tool. When I use this code it works correct but does not include the file extension. So if the user does not type .xls at the end of the filename, the file is not saved as as Excel file when you view from explorer. I tried adding the fileformat:=xlWorkbookNormal but it did not work....Any clues?

Sub SaveMe()
Set NewBook = Workbooks.Add
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
NewBook.SaveAs Filename:=fName
End Sub
 
Have you tried this ?
fName = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")


Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top