Visual Basic .NET "'[method]' is ambiguous across the inherited interfaces" error message when using Office Automation (315981)
The information in this article applies to:
- Microsoft Excel 2002
- Microsoft Excel 2000
- Microsoft Outlook 2002
- Microsoft Outlook 2000
- Microsoft PowerPoint 2002
- Microsoft PowerPoint 2000
- Microsoft Word 2002
- Microsoft Word 2000
- Microsoft Visual Basic .NET (2002)
This article was previously published under Q315981 SYMPTOMS When you use Visual Basic .NET to automate a Microsoft
Office application, and an Automation object has both a method and an event
with the same name, you may receive the following compile time error message
when you build the project: BC30685: '[Method]' is
ambiguous across the inherited interfaces '[Interface1]' and '[Interface2]'.
For example, Word 2000 and Word 2002 expose both a Quit method and a Quit event on the Application object. If your code calls the Quit method, you receive the following compile error message:
'Quit' is ambiguous across the inherited interfaces
'Word._Application' and 'Word.ApplicationEvents3_Event'.
CAUSE When you import a COM reference into your .NET project,
Visual Basic .NET automatically generates a runtime callable wrapper (RCW) to
wrap the component and expose it to the Common Language Runtime as a native
.NET object. This object implements the default interface for the COM object,
and exposes functionality for sinking the default events. If the object that is
wrapped has both a method and an event with the same name, the default RCW sets
up conflicting names, and Visual Basic .NET is unsure which interface member
your code is attempting to access. RESOLUTION To resolve this problem, you can use one of the following
methods:
STATUSMicrosoft is researching this problem and will post more
information in this article when the information becomes
available.
Modification Type: | Minor | Last Reviewed: | 8/12/2005 |
---|
Keywords: | kbvs2002sp1sweep kbAutomation kbbug kbpending KB315981 |
---|
|