COM object method returns error code: 0x800A03EC

76 views
Skip to first unread message

Unknown

unread,
Oct 11, 2010, 5:38:10 AM10/11/10
to jexcel...@teamdev.com
HI,

I am getting the exceptions when I am trying to close the workbook. In the Existing JexcelDemo there is a mothod called beforeWorkbookClose() which is called everytime we clsoe the workbook. I have commented the code which checks whether the workbook is saved or not ? When I try to close the workbook I get Exceptions. Infact I tried to just write the code as ::

public void beforeWorkbookClose(final JWorkbookEventObject eventObject) throws JWorkbookInterruptException {
System.out.println("came in");
_workbook.getApplication().getOleMessageLoop().doInvokeLater(new Runnable() {
public void run() {
List worksheets = _workbook.getWorksheets();
for (int i = 0; i < worksheets.size(); i++) {
Worksheet worksheet = (Worksheet) worksheets.get(i);
worksheet.removeWorksheetEventListener(_worksheetEventLogger);
}
_workbook.removeWorkbookEventListener(_workbookEventLogger);
printLog("Workbook \"" + eventObject.getWorkbook().getWorkbookName() + "\" closed.");
_staticViewAction.setSelected(false);
}
});
}


but all I get the same exception. Even I tried to add a code something like _workbook.close() but nothing changes. And I have added a println which surprisingly prints the text more than 20 times and then throws the exception. I am not sure what is going on and how to resolve this issue. The stackTrace of the Exception is ::

Exception in thread "AWT-EventQueue-0" com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x800A03EC;
at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:654)
at com.jniwrapper.win32.excel.impl._WorkbookImpl.close(_WorkbookImpl.java:353)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.jniwrapper.win32.automation.m.run(SourceFile:233)
at com.jniwrapper.win32.MessageLoopThread$ThreadSynchronizedAction.run(MessageLoopThread.java:544)
at com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:493)

Please Help me with resolving this Issue.

Thanks
Ashish


Unknown

unread,
Oct 11, 2010, 5:38:46 AM10/11/10
to jexcel...@teamdev.com

Hi Ashish,

It seems you try closing workbook in static mode, when workbook is inactive and cannot performs this operation. But to investigate the problem we need an example which reproduce this exception. Please provide us such sample code and we will try to resolve the issue.

Sincerely,

Igor Novikov


Reply all
Reply to author
Forward
0 new messages