Microsoft KB Archive/938303

= 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 =

Article ID: 938303

Article Last Modified on 7/20/2007

-

APPLIES TO


 * Microsoft Internet Explorer 6.0

-



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.



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.  function onSheetChange (Sh, Target) { alert ('R' + Target.Row + 'C' + Target.Column + ' changed to: ' + Target.Value); } document.getElementById('SpreadSheet1').attachEvent('sheetchange', onSheetChange);



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.  alert ('R' + Target.Row + 'C' + Target.Column + ' changed to: ' + Target.Value);



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Keywords: kbexpertiseadvanced kbtshoot kberrmsg kbbug kbprb KB938303

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.