Canceling the execution of the Workbook.save () method for Java (2560)

Hello!

I am addressing you with an request to provide us with support to terminate the Excel document saving operation, regardless of the type/format of the target document.

A couple of months ago, I asked Aspose.Words support if this support existed and how this could be done (workaround) if it didn’t exist (Cancelling of Saving Document process (Java)).
Then Tahir Manzoor replied that support was not yet provided and forwarded the code based on starting the process in a separate thread and terminating it after some time.
Unfortunately, the proposed procedure did not work properly either when working with Word documents or when working with Excel documents - the saving process was not interrupted, and resources were not released.

Therefore, on this occasion, I am not looking for a workaround, but to provide us with a method that will be part of Cells API, and which will cancel the execution of the Workbook.save method.

Best regards!

@zpredojevic,

We do provide means (relevant APIs) to interrupt the loading/saving process in Aspose.Cells for Java. Aspose.Cells for Java supports to interrupt loading/saving process while working with different file format types. See the document with example code for your reference.

@amjad.sahi

Hi! I’m writing on this topic once again.

Unfortunately, the above solution does not work for us.

What we asking from you is to provide us with a method (not a workaround) by which we could terminate the saving operation, so please log this request and provide the mentioned functionality when you are able.

Concretely, the above is necessary for us in situations where the save operation takes too long, so it would be best if this method could (optionally) also receive an argument that would determine the duration of the save operation before it is terminated (e.g. in milliseconds).

Thank you!

Best regards!
Nenad

@zpredojevic,

In the suggested document, we provide mechanism using an example to interrupt/terminate the saving file process via Aspose.Cells. Please refer to it for your reference and then write your own code for your needs. Also, see the example code in another document for your further reference.
https://docs.aspose.com/cells/java/stop-conversion-or-loading-using-interruptmonitor-when-it-is-taking-too-long/
In the example code of the above document, it uses two threads: a monitor thread and conversion thread.

If you still has any confusion or issue, kindly give us a real-time sample Java (runnable) program where the save operation is taking more time and you want to terminate the saving operation (e.g., Workbook.save) after specified time interval. We will check and assist you on writing interrupting code for your requirements.