This documentation is archived and is not being maintained.

Type.IsCOMObject Property

Gets a value indicating whether the Type is a COM object.

[Visual Basic]
Public ReadOnly Property IsCOMObject As Boolean
public bool IsCOMObject {get;}
public: __property bool get_IsCOMObject();
public function get IsCOMObject() : Boolean;

Property Value

true if the Type is a COM object; otherwise, false.


This method returns false for COM interfaces because they are not objects. COM interfaces can be implemented by Microsoft .NET Framework objects.

You can also load a COM class and get a Type object for that COM class by using the Type Library Importer (Tlbimp.exe) tool.


[Visual Basic, C#, C++] The following example shows a use of the IsCOMObject property.

[Visual Basic] 
<ComVisible(False)> _
Public Class MarshalWrapper
    Public Sub MarshalMethod()
        Dim obj As [Object]
        obj = Marshal.GetActiveObject("Excel.Application")
        If Marshal.IsComObject(obj) Then
        End If
    End Sub 'MarshalMethod
End Class 'MarshalWrapper

public class MarshalWrapper {
    public void MarshalMethod() {
        Object obj;
        obj = Marshal.GetActiveObject("Excel.Application");
        if (Marshal.IsComObject(obj)) {

public __gc class MarshalWrapper {
    void MarshalMethod() {
        Object* obj;
        obj = Marshal::GetActiveObject(S"Excel.Application");
        if (Marshal::IsComObject(obj)) {

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Type Class | Type Members | System Namespace | IsCOMObjectImpl