I'm trying to save all .xlsm files in a folder path as .xlsx and although the script works successfully each workbook becomes corrupt. Could someone explain how i can overcome this issue
Thank you in advance.
Set fso = CreateObject("scripting.filesystemobject")
Set fils = fso.GetFolder("LOCATION\").Files
fldrname2 = Worksheets("Applications").Range("A2").Value
For Each fil In fils
fldrname2 = Worksheets("Applications").Range("A2").Value
n = fil.Name
d = fil.DateLastModified
fso.CopyFile fil.Path, fil.ParentFolder & fldrname2 & "-" & fil.Name & ".xlsx"
Next fil