How to automate converting Excel xls files to Excel xml format?

后端 未结 6 1768
渐次进展
渐次进展 2020-12-19 13:05

I have about 200 Excel files that are in standard Excel 2003 format.

I need them all to be saved as Excel xml - basically the same as opening each file and choosing

6条回答
  •  無奈伤痛
    2020-12-19 13:34

    Const xlXLSX = 51
    
    REM 51 = xlOpenXMLWorkbook (without macro's in 2007-2013, xlsx)
    REM 52 = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007-2013, xlsm)
    REM 50 = xlExcel12 (Excel Binary Workbook in 2007-2013 with or without macro's, xlsb)
    REM 56 = xlExcel8 (97-2003 format in Excel 2007-2013, xls)
    
    dim args
    dim file
    dim sFile
    set args=wscript.arguments
    
    dim wshell
    Set wshell = CreateObject("WScript.Shell")
    
    Set objExcel = CreateObject("Excel.Application")
    
    Set objWorkbook = objExcel.Workbooks.Open( wshell.CurrentDirectory&"\"&args(0))
    
    objExcel.DisplayAlerts = FALSE
    
    objExcel.Visible = FALSE
    
    objWorkbook.SaveAs wshell.CurrentDirectory&"\"&args(1), xlXLSX
    
    objExcel.Quit
    
    Wscript.Quit
    

提交回复
热议问题