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

后端 未结 6 1745
渐次进展
渐次进展 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:32

    Sounds like a job for my favorite-most-underrated language of all time: VBScript!!

    Put this in a text file, and make the extension ".vbs":

    set xlapp = CreateObject("Excel.Application")
    set fso = CreateObject("scripting.filesystemobject")
    set myfolder = fso.GetFolder("YOURFOLDERPATHHERE")
    set myfiles = myfolder.Files
    for each f in myfiles
       set mybook = xlapp.Workbooks.Open(f.Path)
       mybook.SaveAs f.Name & ".xml", 47
       mybook.Close
    next
    

    I haven't tested this, but it should work

提交回复
热议问题