Selected Answer
Hello TDog and welcome to the forum,
Your code is close but it needs to remove the ".xlxs" file extesion from the name before saving it as a ".csv" file. I have modified your code to the following. I have tested it using Excel 2016 and works fine on my laptop. (changes are in bold)
Sub DirectoryFileLoop3()
'Loop through files in a folder containing only .xlsx files and .csv files.
'Leave the .csv files as is, but save the .xlsx files as .csv files.
Dim fileDirectory As String
Dim fileCriteria As String
Dim fileName As String
'Dim fileToSave As String ' not required
Dim fileToOpen As Workbook
Application.ScreenUpdating = False
fileDirectory = "C:\Test\Directory\"
fileCriteria = "*.xlsx"
fileName = Dir(fileDirectory & fileCriteria)
'fileToSave = Dir(fileDirectory) ' not required
Do While Len(fileName) > 0
Set fileToOpen = Workbooks.Open(fileDirectory & fileName)
' get file name without extension
fileName = Left(ActiveWorkbook.Name, InStrRev(ActiveWorkbook.Name, ".") - 1)
'MsgBox fileName
fileToOpen.SaveAs fileName:=fileDirectory & fileName, FileFormat:=xlCSV
fileToOpen.Close True
'Debug.Print fileName & ".csv"
fileName = Dir
Loop
Application.ScreenUpdating = True
End Sub
'
If this solves things for you please mark my answer as Selected
Cheers :-)