cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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?

Thanks

Derek.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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 http://www.vbusers.com/codecsharp/codeget.asp?ThreadID=69&PostID=1 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.

Former Member
0 Kudos

I hadn't tried runing SAPlogon as adminstrator! That seem to provide a workaround, but obviously isn't a solution.

Former Member
0 Kudos

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