Late Bind to a COM Component with VB.NET

In VB6 you could use the CreateObject statement to Late Bind to COM or ActiveX components dynamically at runtime.

You can still do late binding to COM components in VB.NET:

    Option Strict Off

    Dim myObj As Object

    Dim t As Type = Type.GetTypeFromProgID("Excel.Application", True)
    myObj = Activator.CreateInstance(t)

    myObj.Open...

    myObj = Nothing

                



About TheScarms
About TheScarms


Sample code
version info

If you use this code, please mention "www.TheScarms.com"

Email this page


© Copyright 2024 TheScarms
Goto top of page