Skip to Content
avatar image
Former Member

Get "Cannot create ActiveX Component" trying to use scripting from VB.Net

In the past, I wrote an application under WinXp using VB2005 to call the GUI scripting functions from VB.NET. This worked fine for many years.

I now need to update it and am running Win7 x64 using VB2010. The GUI installation is 7.20. When I try to run the code, the call

      SapGuiAuto = GetObject("SAPGUI")

fails with an error "Cannot create ActiveX component."

The GUI is running and I am generating x86 code (not x64). Scripting works fine when run from a VBScript file.

What am I missing or doing wrong?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 09, 2011 at 02:25 PM

    I also tried ...

                Wrapper = CreateObject("SapROTWr.SapROTWrapper")
                SapGuiAuto = Wrapper.GetROTEntry("SAPGUI")
                SapGuiApp = SapGuiAuto.GetScriptingEngine

    This fails when trying to use SapGuiAuto because it's null.

    I also tried the applicsation at to list the contents on the Running Object Table (ROT). This doesn't seem to list much. Is there a privilege problem?

    I've tried running things a administrator but it doesn't seem to make any difference.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I have the same issue with a single computer. But I tried run the SAPlogon as admin and doesn't work.

      Is a strange error; I used the code to connect to SAP in more than 100 computers and all have a similar configuration.

      This is the error:

      Cannot create ActiveX component.

      SOURCE = Microsoft.VisualBasic.Interaction.GetObject

      This is the specific line when the error is raise:

      SAPgui = CreateObject("SAPGUI").GetScriptingEngine

      Windows 7

      SAP 7.20