EasyXLS
http://forum.easyxls.com/

XLS file in use throws NET exception
http://forum.easyxls.com/viewtopic.php?f=4&t=2245
Page 1 of 1

Author:  garywtx [ Fri Nov 23, 2018 4:17 pm ]
Post subject:  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

Author:  daniela [ Mon Nov 26, 2018 8:43 am ]
Post subject:  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.

Author:  garywtx [ Tue Nov 27, 2018 3:27 am ]
Post subject:  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

Author:  daniela [ Tue Nov 27, 2018 3:34 am ]
Post subject:  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

Author:  garywtx [ Tue Nov 27, 2018 12:00 pm ]
Post subject:  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?

Author:  daniela [ Wed Nov 28, 2018 5:27 am ]
Post subject:  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.

Author:  garywtx [ Wed Nov 28, 2018 12:55 pm ]
Post subject:  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

Author:  daniela [ Thu Nov 29, 2018 4:50 am ]
Post subject:  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.

Author:  garywtx [ Thu Nov 29, 2018 6:56 am ]
Post subject:  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

Author:  daniela [ Thu Nov 29, 2018 8:21 am ]
Post subject:  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.

Author:  garywtx [ Thu Nov 29, 2018 1:48 pm ]
Post subject:  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?

Author:  garywtx [ Fri Nov 30, 2018 9:34 am ]
Post subject:  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?

Author:  daniela [ Sat Dec 01, 2018 3:03 am ]
Post subject:  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.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/