Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

# Windows 7: "The server threw an exception error" when running Excel-to-CSV.Vbs

 27 Jan 2017 #11 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts OK, thanks for your help with this. I have tried the new code and it works OK with "True", but when I change it to "False" it returns the same old error: "the server threw an exception" at line 16 this time (in my original script it was at line 17). Re: installing Office again, that was the first thing I did when the error came up, and nothing changed: still same error messages, with both Perl and .vbs scripts. My System Specs
 .
 27 Jan 2017 #12 Pyprohly Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan 722 posts In a house According to other sources, there may be an issue with this particular COM object in Windows 7 if the object doesn’t have administrative rights. I’m not using Windows 7 to test your script so I can’t tell you if this issue is actually the expected behaviour for this platform. Try using an Elevated Command Prompt. I’m linking your SO cross post here. My System Specs
 27 Jan 2017 #13 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts I wonder if using an Elevated Command Prompt would work in a .bat context. I need to use this script converter xls to csv from a .bat, I will not type the instruction manually in cmd prompt each time. My System Specs
 .
 27 Jan 2017 #14 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts Maybe I have found a way to do it: Bat To Exe Converter | F2KO Software Basically: create a .bat, convert it to an .exe with the above program and then run the .exe as admin. I have not tested this yet, I will report if it works or not. EDIT: I have tested it and it does not work. Basically I have created the .bat containing the following command line as an .exe, then run the .exe as administrator: Excel-to-Csv.vbs test.xlsx test.csv The Excel-to-Csv.vbs file contains the original code I posted at the start of the thread, the one that gave the error. I still get the same error even if I run it as administrator, when compiled as an .exe. So, I guess the issue is somewhere else, the mysteries of Windows 7... My System Specs
 27 Jan 2017 #15 Pyprohly Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan 722 posts In a house No, no, no. Don’t do that. If you introduce yourself to complications while doing this you’ll just confuse yourself. It would seem to me that you are unsure of how to run a VBScript on the command line. But how are you running the script currently then? In an Elevated Command Prompt run, Code: "C:\path\to\Excel-to-CSV.Vbs" "C:\path\to\input.xlsx" "C:\path\to\output.csv" My System Specs
 27 Jan 2017 #16 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts Currently, I have a .bat that contains several command lines that trigger different scripts (a poor man's way of writing a code, I use it to manipulate a number of Excel files quickly, mostly copy and paste data and perform some calculation, if done manually it would be too long and too tedious while with the .bat is quick and precise). For example, my bat could look like this: script.pl do this and that operation on file1.xlsx ren file1.xlsx file2.xlsx excel-to-csv.vbs file2.xlsx file2.csv here is where I get stuck: the .vbs command line fails and triggers the error message discussed in this thread. How would I run the command line above from within a .bat with an elevated prompt? My System Specs
 27 Jan 2017 #17 Pyprohly Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan 722 posts In a house We’re not going to use batch files at all right now, alright? It’s called isolating the problem. Just open an elevated CMD and enter commands similar to this. Code: C:\>cd C:\path\to\folder\containing\execl-to-csv\script C:\path\to\folder\containing\execl-to-csv\script>excel-to-csv.vbs file2.xlsx file2.csv I’ll have to get back to you later on this. My System Specs
 27 Jan 2017 #18 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts Quote: Originally Posted by Pyprohly In an Elevated Command Prompt run, Code: "C:\path\to\Excel-to-CSV.Vbs" "C:\path\to\input.xlsx" "C:\path\to\output.csv" No worries, so I have run the above from a cmd prompt (run as administrator), changing path to the folder where I have the old/original Excel-to-CSV.Vbs: "C:\AT\temp\Excel-to-Csv.vbs" "C:\AT\temp\test.xls" "C:\AT\temp\test.csv" The result is the usual error msg: the server threw an exception, etc. My System Specs
 24 Feb 2017 #19 JohnSmithWin7 Windows 7 32 and 64 bit (dual boot) 11 posts Pyprohly, just wanted to say thanks, your workaround solved somehow the issue. Worksforme. My System Specs