Option Explicit
'批量转换文件夹中的xls为csv
Sub covertFile(ByRef sFilename As String)
Dim oWorkbook As Workbook
Set oWorkbook = Workbooks.Open(Filename:=sFilename)
oWorkbook.SaveAs Filename:=sFilename & ".csv", FileFormat:= _
xlCSV, CreateBackup:=False
oWorkbook.Close False
End Sub
Sub covertFiles()
Dim sPath As String
Dim sDir As String
sPath = "K:\Desktop\List"
sDir = Dir(sPath & "\*.xls")
While Len(sDir)
Debug.Print sDir
covertFile sPath & "\" & sDir
sDir = Dir
Wend
End Sub