All Forums >> [Scripting] >> WSH & Client Side VBScript >> Convert XML file to Excel 2003 XLS file Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I have searched countless forums and have an interesting one (maybe easy for some). I have the following code that opens an XML file in a specific directory and then saves it as an excel 2003 file. What the script does is it searches the directory for all files and loops through them that have the word Test in the filename. Once it finds it, I want it to be opened (as it is in XML) and save it again as the same file name but as a normal excel 2003 workbook. The xml file has been saved with a .xls extension.
When I run this code in MS Excel VBA it works fine but when I run it as a VBS file it has an error. The error specifies the following details : Line 51, Char 58, Error: Expected Statement, Code: 800A0400, Source: Microsoft Compilation Error.
I have determined that the error is about this line and at the point of File being saved in another format.
I have tried xlNormal, xlWorkbookNormal, xlExcell11, -4143 but the script file can't understand the statement.