Workbooks.SaveAs - How to have it saved with .xls extension?

G

Guest

I have:

Set ReportBook = Workbooks.Add()

Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ReportBook.SaveAs Filename:=fName

The filename is not automatically .xls extension. How would I have it so
that when the user types Report in the FileName, the workbook gets saved as
..xls?
 
P

par_60056

I have:

Set ReportBook = Workbooks.Add()

Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ReportBook.SaveAs Filename:=fName

The filename is not automatically .xls extension. How would I have it so
that when the user types Report in the FileName, the workbook gets saved as
.xls?


If ucase(right(fname,4)) <> ".XLS" then fname=fname+".xls"

Peter
 

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