Windows 7 Forums

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)
 
 

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 SpecsSystem Spec
.
27 Jan 2017   #12
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 SpecsSystem Spec
27 Jan 2017   #13
JohnSmithWin7

Windows 7 32 and 64 bit (dual boot)
 
 

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 SpecsSystem Spec
.

27 Jan 2017   #14
JohnSmithWin7

Windows 7 32 and 64 bit (dual boot)
 
 

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 SpecsSystem Spec
27 Jan 2017   #15
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 SpecsSystem Spec
27 Jan 2017   #16
JohnSmithWin7

Windows 7 32 and 64 bit (dual boot)
 
 

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 SpecsSystem Spec
27 Jan 2017   #17
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 SpecsSystem Spec
27 Jan 2017   #18
JohnSmithWin7

Windows 7 32 and 64 bit (dual boot)
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
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 SpecsSystem Spec
24 Feb 2017   #19
JohnSmithWin7

Windows 7 32 and 64 bit (dual boot)
 
 

Pyprohly, just wanted to say thanks, your workaround solved somehow the issue. Worksforme.
My System SpecsSystem Spec
Reply

 "The server threw an exception error" when running Excel-to-CSV.Vbs




Thread Tools




Similar help and support threads
Thread Forum
Excel ('13) - "Document not saved" error + performance issues
Hi, Issue is with an Excel document that runs a macro to report information from another data sheet: Raw data - 3MB Macro - 8MB Result file - 120MB When the macro is complete; 1. The document shows an error when trying to save (see screenshot with error) -- Black icons show within the save...
Microsoft Office
websites not loading - error on page "500 internal server error nginx"
For the last 2 days, I am not able to access all google sites and facebook.com from my windows 7 PC. When I tried to access these websites, I am getting a blank page with the error message "500 internal server error -nginx". Can you please suggest me what could be the cause for this issue and how...
Browsers & Mail
Random "Bad Pool Header" and "System Service Exception" BSODs
I have been getting these "Bad Pool Header" and "System Service Exception" BSODs for about a day now (the "Bad Pool Header" one tends to pop up more often then the other btw). I ran a registry cleaner which didn't work and ran memtest this morning and it showed that my memory was fine. The BSODs...
BSOD Help and Support
Error: "exception processing message parameters 0xc000007FEFC3E718C"
Hi. I've been getting this error message: "exception processing message parameters 0xc000007FEFC3E718C" every time I shut down or log off, accompanied by "Bad Image" messages from time to time, usually concerning davhlpr.dll. I've run the System File Checker three times, and each time it...
BSOD Help and Support
Win7 "workstation" to WinXP "server" file copy FAIL
This is driving me bonkers and I have almost no hair left. I really hope someone can help. When I attempt to copy or move a file or folder from my Win7 box to my WinXP (SP3) media server, the operation nearly always fails. Take, for example, my trying to copy the VLC Media Player folder (704...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:56.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App