Function RenameExcelFile(strFileName As String, strNewName As String, strNewFileType As String)
' xlCSV for CSV
'xlNormal for normal Excel for the current version
Const xlCSV As Integer = 6
Const xlNormal As Integer = -4143
Dim objXL As Object
Dim xlWB As Object
Set objXL = CreateObject("Excel.Application")
Set xlWB = objXL.Workbooks.Open(strFileName)
xlWB.SaveAs strNewName, strNewFileType
xlWB.Close False
objXL.Application.Quit
Set xlWB = Nothing
Set objXL = Nothing
End Function