Convert Multiple CSV Files to XLS Files (Again)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everyone,

I am still trying to convert a folder full of CSV files to XLS files. In an
earlier post I was given a macro, as shown here:



Sub TransformCSVToXls()
Application.DisplayAlerts = False
myFile = ActiveWorkbook.Name
myPath = "C:\Documents and Settings\DEITBE\My Documents\Excel\Delete These\"
WorkFile = Dir(myPath & "*.CSV")

Do While WorkFile <> ""
Application.StatusBar = "Now working on " & WorkFile
Workbooks.Open FileName:=myPath & WorkFile
MsgBox ActiveWorkbook.Name
ActiveWorkbook.SaveAs FileName:=myPath & _
Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4),
FileFormat:=xlNormal
ActiveWorkbook.Close
Windows(myFile).Activate
WorkFile = Dir()
Loop

Application.StatusBar = False

End Sub




I would really appreciate if someone could a) tell me if this macro actually
will work, and b) edit it so that I can use it in my situation.

I have a few requirements, being:

* The folder containing the CSV files will be called GMS, and will be a
subfolder of the macro i.e. C:\MACRO_IN_HERE\GMS\
* I do not want any message boxes or windows to pop up. I simply want the
macro to open 20 or so csv files and change them all to XLS files.

Thanks!
Dave
 
Back
Top