OWC Spreadsheet events do crash IE6

P

Peter Meinl

Using OWC 11 Spreadsheet events in ASP.NET 2.0 JavaScript causes IE6 to
crash.

I need to use the events for IsDirty handling and for validating formula
results (which OWC Spread seems not to support in contrast to Excel).

Steps to reproduce:
1.
Change a cell value and press tab
The event handler alerts the change.
Click OK.

2.
Click the button named "Button".
OWC.dll crashes.

Complete source code:
----------------------

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<object id="SpreadSheet1"
classid="CLSID:0002E559-0000-0000-C000-000000000046"
style="width:49%;height:350"></object>

<div>
<asp:Button ID="Button1" runat="server" Text="Button" /></div>

<script type="text/javascript">
function onSheetChange (Sh, Target)
{
alert ('R' + Target.Row + 'C' + Target.Column + ' changed to: ' +
Target.Value);
}
document.getElementById('SpreadSheet1').attachEvent('sheetchange',
onSheetChange);
</script>
</form>
</body>
</html>
 
A

Alvin Bruney [MVP]

Nope, no crash here. Oh wait. I'm using IE7 so that makes it more of an IE
problem than OWC. Try updating your IE6 to see if that helps.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
P

Peter Meinl

Yes, it only seems to happen with IE6 and not with IE7.
I opened a service request with MS.
 
P

Peter Meinl

MS support was able to reproduce the problem using attachEvent().
They suggested the following workaround using a script tag which works fine
for me.

<script type="text/javascript" for="SpreadSheet1"
event="sheetchange(sh,Target)">

//function onSheetChange (Sh, Target)
//{
alert ('R' + Target.Row + 'C' + Target.Column + ' changed to: ' +
Target.Value);
//}
//document.getElementById('SpreadSheet1').attachEvent('sheetchange',
onSheetChange);
</script>
 
A

Alvin Bruney [MVP]

where was the bug? in owc or in IE?

Thanks for posting the workaround and write up

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
P

Peter Meinl

I do not know where exactly the problem lies: OWC Spreadsheet and IE6 and
attachtEvent seem not to play well together. One support engineer told me,
he was able to reproduce the problem with IE7 too. I my tests it only
happened with IE6.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top