- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objExcel = CreateObject("Excel.Application")
- objExcel.DisplayAlerts = False
-
- strFolder = CreateObject("Wscript.Shell").CurrentDirectory & "\"
-
- Set objFiles = objFSO.GetFolder(strFolder).Files
- For Each objFile In objFiles
- If Lcase(Split(objFile.Name, ".")(1)) = "xls" Then
- Set objWorkbook = objExcel.Workbooks.Open(strFolder & objFile.Name)
- objWorkbook.SaveAs strFolder & Split(objFile.Name, ".")(0) & ".csv", 6
- objWorkbook.Close
- End If
- Next
-
- objExcel.Quit
复制代码
|