Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Internet Explorer stops responding when you use the AttachEvent method in an ASP.NET application to embed a Microsoft Office Web Components spreadsheet control in Internet Explorer 6


View products that this article applies to.

Symptoms

You use the AttachEvent method in a Microsoft ASP.NET application. You try to use this method to embed a Microsoft Office Web Components spreadsheet control in Microsoft Internet Explorer 6. When you do this, Internet Explorer stops responding. When you try to close Internet Explorer or when you click a button in the application, Internet Explorer stops unexpectedly. Additionally, you receive the following error message:
Internet Explorer has encountered a problem with an add-on and needs to close.

The following add-on was running when the problem occurred:

File: owc11.dll
Company Name: Microsoft Corporation
Description: Microsoft Office Web Components 2003
Learn more about add-ons.
When you click Continue to close the error message, you receive the following error message:
Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience.

If you were in the middle of something, the information you where working on might be lost.

Please tell Microsoft about this problem!

We have created an error report that you can send to help us to improve
Internet Explorer. We will treat this report as confidential and anonymous.

To see what data this report contains click here.
Note This problem does not occur when you use Windows Internet Explorer 7.

↑ Back to the top


Cause

This problem occurs because of behavior that occurs when you use the AttachEvent method. When you do this, the interface pointer that is referenced by the spreadsheet control may be released before the control is completely shut down. When this problem occurs, Internet Explorer cannot release the pointer after the pointer has already been released. For example, this problem occurs when you use code that resembles the following example.
<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>

↑ Back to the top


Resolution

To resolve this problem, use attributes instead of events in the code for the application. Then, try running the application again. For example, use code that resembles the following code example.
<script type="text/javascript" for="SpreadSheet1" event="sheetchange(sh,Target)">
alert ('R' + Target.Row + 'C' + Target.Column + ' changed to: ' + Target.Value);
</script>

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Keywords: KB938303, kbprb, kbbug, kberrmsg, kbtshoot, kbexpertiseadvanced

↑ Back to the top

Article Info
Article ID : 938303
Revision : 1
Created on : 7/20/2007
Published on : 7/20/2007
Exists online : False
Views : 254