I try to save a new file .xlsx with the name of the worksheet, it works with .xls but I needed in a new version. Txs
The code I'm using is:
![]()
Please Login or Register to view this content.
I try to save a new file .xlsx with the name of the worksheet, it works with .xls but I needed in a new version. Txs
The code I'm using is:
![]()
Please Login or Register to view this content.
Last edited by Leith Ross; 10-27-2014 at 08:54 PM. Reason: Added Code Tags
Hello Mikeswell,
Welcome to the Forum!
An xls may or may not have macros. In newer versions of Excel workbooks can be saved only as xlsx if the workbook does not contain macros. If does have macros then it has to saved as xlsm.
You will need a macro to determine if the xls workbook has macros or not, unless this is a one time save and you know if it has macros or not.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
txs for your answer Leith.
Hello Mikeswell,
Did that solve your problem?
yes,
Dim fname1, fname2 As String
' Selefila is the row number
' The names were in the a different sheet (T4)than the one saved
' The name of the file were on different cells
fname1 = Sheets("T4-AOPLC-1").Cells(11, 8).Value
fname2 = Sheets("T4-AOPLC-1").Cells(selefila, 34).Value
Sheets("T4").Copy
ActiveWorkbook.SaveAs Filename:=fname1 & fname2, FileFormat:=xlNormal, ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close 0
Txs again Leith.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks