Connecting to OPC Server from VB 2012 winforms project RRS feed

  • Question

  • I want to connect an OPC Server in my project.

    I define a connection to the OPC Server and when I run the following code:

            Dim GlobalOPCServer As OPCAutomation.OPCServerClass

            Dim ConnectedOPCServer As OPCAutomation.OPCServerClass

            Dim ConnectedGroup As OPCAutomation.OPCGroupClass

            GlobalOPCServer = New OPCAutomation.OPCServerClass()

            Dim ServerList As Object = GlobalOPCServer.GetOPCServers

            For index As Short = LBound(ServerList) To UBound(ServerList)



            GlobalOPCServer = Nothing

    I get the following error on "GlobalOPCServer = New OPCAutomation.OPCServerClass()" line:

    Retrieving the COM class factory for component with CLSID 
    failed due to the following error: 
    80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    Monday, July 8, 2019 1:22 AM

All replies

  • Hi,

    This forum is discussing and asking questions about the Windows Forms and ClickOnce. And the MSDN only handles issues related to Microsoft products, not other third-party services.

    Here I found a website maybe you can have a look.


    Thank you for your understanding.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 8, 2019 5:15 AM