Reply to topic  [ 13 posts ] 
XLS file in use throws NET exception 
Author Message

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post XLS file in use throws NET exception
Using Win 7 console application, if I try to write to a XLS file that is in use,
it throws the NET Exception dump into the console windows,
is there a way to prevent this?

sample error on console screen

The process cannot access the file wpd.xls because it is being used by another process.
at System. IO. etc


Fri Nov 23, 2018 4:17 pm
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
If you can control how the file is open for the first time, you can open the xls file in share mode.

Then, you can create a FileStream, also in share mode:

System.IO.FileStream stream = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);

and use this stream with the method that reads the Excel file.

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Mon Nov 26, 2018 8:43 am
Profile WWW

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
Ok, not what I needed, I need it to not throw the exception info all over the application screen,
and force the application to stop responding, and to allow me to grab the error from easy_getError()

I would assume if there is a easy_getError() function, that your application would catch the exception dump


Tue Nov 27, 2018 3:27 am
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
You can hide the console messages by setting as FALSE the parameter of ExcelOptions.setDisplayErrors() and then extract the error using ExcelDocument.easy_getError() method. More about:
https://www.easyxls.com/manual/tips-and-tricks/error-messages.html

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Tue Nov 27, 2018 3:34 am
Profile WWW

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
I dont see any examples on how to use Excel Options, testing with code

oXLS := CreateObject( 'EasyXLS.ExcelDocument' )

oXLSOptions := CreateObject( 'EasyXLS.ExcelOptions' )
oXLSOptions:DisplayErrors()
oXLSOptions:setDisplayErrors( 0 )

The last two lines are basically telling me there is no such method, so what am I missing here?


Tue Nov 27, 2018 12:00 pm
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
Unfortunately that method is static and cannot be accessed from VBScript. I supposed that you are using C# or another .NET programming language.
You can try a "try/catch" statement.

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Wed Nov 28, 2018 5:27 am
Profile WWW

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
Not using a dot NET language, using xHarbour, a clipper clone, went with EasyXLS as it a OLE/COM+ package,
problem is, even in a TRY/CATCH, it still dumps the data to the screen, and some time locks up the application

So I still need a working solution that does not lockup


Wed Nov 28, 2018 12:55 pm
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
In this situation, we can provide you a demo version with ExcelOptions.setDisplayErrors() method also available for COM+. Let us know if you need 32-bit or 64-bit version.

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Thu Nov 29, 2018 4:50 am
Profile WWW

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
"Demo version" ?

So after purchasing the professional edition, I need to purchase another package?
I don't see this on the list of products. We were under the impression that the professional
package included all items


Thu Nov 29, 2018 6:56 am
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
If you have already purchased the Professional Edition, then you will receive a patch for .NET Professional, not for the trial.

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Thu Nov 29, 2018 8:21 am
Profile WWW

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
The I need the 32 bit patch for professional.

And if we decided to purchase a server based license, will we need to request a fixed version also?


Thu Nov 29, 2018 1:48 pm
Profile

Joined: Fri Nov 23, 2018 9:54 am
Posts: 7
Reply with quote
Post Re: XLS file in use throws NET exception
Is there an actual company here?
No response in almost 24 hrs, no response to telephone calls, so why did we pay for support if there is none?


Fri Nov 30, 2018 9:34 am
Profile

Joined: Fri Feb 03, 2006 12:23 pm
Posts: 157
Location: Brasov, Romania
Reply with quote
Post Re: XLS file in use throws NET exception
You will receive the patch on Monday.
When you will buy the server license, you can use the same patch.

_________________
EasyXLS Team
.NET and Java library to read and write Excel files
Facebook Twitter Reddit LinkedIn


Sat Dec 01, 2018 3:03 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.