我想用如下程序,把文件夹中的EXCEL全部变成CSV,为什么总是报错?
Dim oExcel
Set oExcel = WScript.CreateObject("Excel.Application")
Set fso = WScript.CreateObject("Scripting.Filesystemobject")
Set fds = fso.GetFolder(".") '表示vbs所在的文件夹
Set ffs = fds.Files
For Each ff In ffs
If LCase(Right(ff.Name, 5)) = ".xlsx" Then '只处理.xlsx文件
Set owk = oExcel.Workbooks.Open(ff.Path)
csvname = Left(ff.Path, Len(ff.Path) - 5)
owk.SaveAs csvname, 6 '6代表csv格式
oExcel.ActiveWorkbook.Saved = True
owk.Close
End If
Next
On Error Resume Next
oExcel.Quit
附件列表