Dim xlApp, xlWkb, SourceFolder,TargetFolder,file Set xlApp = CreateObject("excel.application") set fs = CreateObject("Scripting.FileSystemObject") Const xlNormal=1 SourceFolder="c:\temp\XMLfiles" TargetFolder="c:\temp\XLSfiles" 'Hide Excel xlApp.Visible = false 'Process each file in SourceFolder for each file in fs.GetFolder(SourceFolder).files 'Open file in SourceFolder Set xlWkb = xlApp.Workbooks.Open(file) 'Get Filename BaseName= fs.getbasename(file) 'Concatenate full path. Extension will be automatically added by Excel FullTargetPath=TargetFolder & "\" & BaseName 'Save as XLS file into TargetFolder xlWkb.SaveAs FullTargetPath, xlNormal 'Close file xlWkb.close next Set xlWkb = Nothing Set xlApp = Nothing Set fs = Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)