OWC Crashing Issue
When you edit a cell in OWC spreadsheet control. a General Protection Fault is thrown which closes the browser.
runtime error !
Program: C:\Program Files\Internet Explorer\IEXPLORE.EXE
R6025 - pure virtual function call
You can also get this error if you use javascript alert statement in any spreadsheet event.
Here is the solution for this error
How to embed OWC Spreadsheet in a webpage
<body id="body" style="padding:0px;margin:0;" scroll="no" oncontextmenu="return true;">
<div x:publishsource="Excel">
<object id="spread" class="spread" classid="CLSID:0002E541-0000-0000-C000-000000000046" viewastext>
<param name="DataType" value="HTMLDATA">
<!--param name="AutoFit" value="true"-->
<param name="DisplayPropertyToolbox" value="false">
<param name="DisplayColoumnHeadings" value="false">
<param name="DisplayGridlines" value="true">
<param name="DisplayOfficeLogo" value="false">
<param name="DisplayRowHeadings" value="false">
<param name="DisplayTitleBar" value="false">
<param name="DisplayToolbar" value="false">
<param name="DisplayVerticalScrollBar" value="true">
<param name="AllowPropertyToolbox" value="false">
<!--param name="EnableResize" value="false"-->
<param name="EnableAutoCalculate" value="true">
<param name="EnableEvents" value="true">
<param name="MoveAfterReturn" value="true">
<param name="MoveAfterReturnDirection" value="0">
<param name="RightToLeft" value="0">
<param name="ViewableRange" value="1:65536">
</object>
</div>
</body>
how to handle spreadsheet events in javascript
StartEdit event Occurs whenever the user enters edit mode while the mouse pointer is in a cell.
<script language="javascript" for="spread" event="StartEdit (Selection, InitialValue, Cancel, ErrorDescription)">
<!--
spread_StartEdit (Selection, InitialValue, Cancel, ErrorDescription);
//-->
</script>
EndEdit event occurs whenever the user switches from edit mode on the specified Spreadsheet Control. You can use this event to validate data entry in a worksheet.
<script language="javascript" for="spread" event="EndEdit(Accept,FinalValue,Cancel,ErrorDescription)">
<!--
spread_EndEdit(Accept, FinalValue, Cancel, ErrorDescription);
//-->
</script>
<script language="javascript">
function spread_StartEdit (Selection, InitialValue, Cancel, ErrorDescription)
{
/// you need to disable event at first line of this function to fix the runtime error R6025 Pure virtual function call
spread.EnableEvents = false;
try
{
//Write your code
}
catch(err)
{
//Catch any error
}
finally
{
//Enable event again
spread.EnableEvents = true;
}
}
function spread_EndEdit (Selection, InitialValue, Cancel, ErrorDescription)
{
/// you need to disable event at first line of this function to fix the runtime error R6025 Pure virtual function call
spread.EnableEvents = false;
try
{
//Write your code
}
catch(err)
{
//Catch any error
}
finally
{
//Enable event again
spread.EnableEvents = true;
}
}
</script>