ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Saving a file (https://www.excelbanter.com/excel-worksheet-functions/105425-saving-file.html)

dan

Saving a file
 
I have the following statements:

DataFileName = Application.GetOpenFilename(fileFilter:="Text or ASC Files,
*.txt; *.asc", Title:="Select the Data File")

....code

'Saves The File (As Sheetx) And Leaves It Open
ActiveWorkbook.SaveAs

'Saves File As DataFileName But With The Extension Of the File Opened TXT
Format And Not In Excel Format
ActiveWorkbook.SaveAs (DataFileName)

'Receive Syntax Error
ActiveWorkbook.SaveAs (DataFileName, FileFormat:="Excel (*.xls), *.xls")

What am I missing?


Dave Peterson

Saving a file
 
You have a response at your other post.

Dan wrote:

I have the following statements:

DataFileName = Application.GetOpenFilename(fileFilter:="Text or ASC Files,
*.txt; *.asc", Title:="Select the Data File")

...code

'Saves The File (As Sheetx) And Leaves It Open
ActiveWorkbook.SaveAs

'Saves File As DataFileName But With The Extension Of the File Opened TXT
Format And Not In Excel Format
ActiveWorkbook.SaveAs (DataFileName)

'Receive Syntax Error
ActiveWorkbook.SaveAs (DataFileName, FileFormat:="Excel (*.xls), *.xls")

What am I missing?


--

Dave Peterson


All times are GMT +1. The time now is 11:08 PM.

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