Microsoft KB Archive/282145

= Compiler error when implementing the ISmartTagAction interface or the ISmartTagRecognizer interface in a Visual Basic project =

Article ID: 282145

Article Last Modified on 5/24/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic for Applications 6.0

-



This article was previously published under Q282145



SYMPTOMS
When you compile a Visual Basic project that uses the ISmartTagAction and ISmartTagRecognizer interfaces, you receive unexpected error messages. This problem occurs when your Visual Basic project includes references to the Microsoft Smart Tags 1.0 Type Library and one or more of the following object libraries:
 * Microsoft Excel 12.0 Object Library
 * Microsoft Excel 11.0 Object Library
 * Microsoft Excel 10.0 Object Library



CAUSE
The Excel object libraries and the Microsoft Smart Tags 1.0 Type Library both include interfaces named ISmartTagAction and ISmartTagRecognizer. If your project references both of these libraries and you implement the interface without fully qualifying the interface name, the compiler attempts to use the first matching interface that it encounters in the project's list of references. If the compiler does not choose the type library you intend to use, a compiler error can occur.



RESOLUTION
To correct this problem, fully qualify the interface name in your Implements statement. To implement ISmartTagRecognizer in the Smart Tags library, use the following: Implements SmartTagLib.ISmartTagRecognizer Full qualification ensures that the compiler uses a specific type library and does not rely on the order of project references.

