Article ID: 315981 - Last Review: January 30, 2007 - Revision: 4.3 Visual Basic .NET "'[method]' is ambiguous across the inherited interfaces" error message when using Office AutomationThis article was previously published under Q315981 On This PageSYMPTOMS 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]'.
'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. MORE INFORMATION Office applications are not the only COM servers that may
exhibit this problem when they are automated in Visual Basic .NET. The problem
is not with the COM server or Visual Basic .NET itself, but with the RCW that
the .NET Framework generates. By default, the type library importer for .NET
does not resolve conflicting names. The following Office Automation objects and methods may generate this compile error message if a standard RCW is generated for your Visual Basic .NET project: Steps to Reproduce the Behavior
APPLIES TO
| Article Translations
|
Back to the top
