This article has been archived. It is offered "as is" and will no longer be updated.
The Microsoft Visual Studio .NET or Visual Studio 2005 client application cannot catch the events that are raised by an existing ActiveX control (Microsoft Office Spreadsheet 11.0).
When the Microsoft Office Spreadsheet 11.0 ActiveX control raises events, managed code cannot catch these events.
The IChartInterface interface of the OWC11.dll file has dispatch identifiers (DISPIDs) on its methods. When you derive the event listener class from the IChartInterface interface, the overridden methods do not support the DISPIDs of the IChartInterface interface. When the Microsoft Office Spreadsheet 11.0 tries to raise the event, the event listener class cannot find the DISPIDs.
To resolve this problem, follow these steps:
Run the AxImp.exe tool on the OWC11.dll file.
Locate the OWC11.dll file. The OWC11.dll file is a DLL for the Microsoft Office Spreadsheet 11.0 ActiveX control. The OWC11.dll file is typically located in the following folder: C:\Program Files\Common Files\Microsoft Shared\Web Components\11.
Click Start, click Run, and then type cmd in the Open box.
At the command prompt, locate the OWC11.dll file.
Type aximp /source OWC11.dll at the command prompt. You notice that the AxOWC11.dll file and the AxOWC11.cs file are generated and are placed in the same folder where this command is executed.
The AxImp.exe file converts the whole ActiveX control type library and produces a set of assemblies that contain the common language runtime metadata and control implementation for the types that are defined in the original type library.
Modify the AxOWC11.cs file. To do this, add the code in the following steps to modify all the Control classes and the corresponding EventMulticaster classes in the source file that is generated.
Set the ToolboxItem attribute to true in the generated class file. To do this Add the following code before the Control classes:
The Control classes are as follows:
Add the following code above the EventMulticaster classes:
Microsoft Visual Basic 2005, Microsoft Visual Basic .NET 2003 Standard Edition, Microsoft Visual Basic .NET 2002 Standard Edition, Microsoft Visual C# 2005 Express Edition, Microsoft Visual C# .NET 2003 Standard Edition, Microsoft Visual C# .NET 2002 Standard Edition