SES
04-29-2013, 11:59 PM
Hi,
I need to automatize the conversion of ''.txt'' files to ''.xls''.
For this purpose, I Have made the following macro :
Sub GetSheets()
Path = "C:\Users\...\"
Filename = Dir(Path & "*.txt")
Do While Filename <> ""
Workbooks.Open Filename
ActiveWorkbook.SaveAs Filename, FileFormat:=xlNormal
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
For a reason I ignore, once the macro is finished, the files are always in .txt instead of .xls...
Would you help me solve this issue plz ?
Thx
I need to automatize the conversion of ''.txt'' files to ''.xls''.
For this purpose, I Have made the following macro :
Sub GetSheets()
Path = "C:\Users\...\"
Filename = Dir(Path & "*.txt")
Do While Filename <> ""
Workbooks.Open Filename
ActiveWorkbook.SaveAs Filename, FileFormat:=xlNormal
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
For a reason I ignore, once the macro is finished, the files are always in .txt instead of .xls...
Would you help me solve this issue plz ?
Thx