ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbooks.SaveAs - How to have it saved with .xls extension? (https://www.excelbanter.com/excel-programming/392599-workbooks-saveas-how-have-saved-xls-extension.html)

J@Y

Workbooks.SaveAs - How to have it saved with .xls extension?
 
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?


[email protected]

Workbooks.SaveAs - How to have it saved with .xls extension?
 
On Jul 3, 10:22 am, J@Y wrote:
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


J@Y

Workbooks.SaveAs - How to have it saved with .xls extension?
 
I guess its a manual process. Thanks!

" wrote:

On Jul 3, 10:22 am, J@Y wrote:
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




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

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