ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save text file as Excel 2007 with cell as filename (https://www.excelbanter.com/excel-programming/434916-save-text-file-excel-2007-cell-filename.html)

KellyInCali

Save text file as Excel 2007 with cell as filename
 
I have a delimited file which has been reformatted and need to save it as
Excel 2007workbook (.xlsx?) I am using the contents of a cell as the
filename. It is saving, but when I try and re-open it it says the file
extension is not recognized. If I save as .xls it has the old 2003 icon on
the file. Also, I don't want the file to prompt the user to re-save when
they try and close. Here is what I have:

Range("A1").Select
ActiveWorkbook.SaveAs Filename:=Range("Z1").Value & ".xlsx"

End Sub

Thanks,
Kelly

Dave Peterson

Save text file as Excel 2007 with cell as filename
 
Make sure you specify the correct fileformat, too.

See help for .saveas for more details.

KellyinCali wrote:

I have a delimited file which has been reformatted and need to save it as
Excel 2007workbook (.xlsx?) I am using the contents of a cell as the
filename. It is saving, but when I try and re-open it it says the file
extension is not recognized. If I save as .xls it has the old 2003 icon on
the file. Also, I don't want the file to prompt the user to re-save when
they try and close. Here is what I have:

Range("A1").Select
ActiveWorkbook.SaveAs Filename:=Range("Z1").Value & ".xlsx"

End Sub

Thanks,
Kelly


--

Dave Peterson


All times are GMT +1. The time now is 12:17 AM.

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