Skip to Content

SAP GUI Scripting API now Accessible from x64 Application

Today I checked the possibilities of VS Code in the context of SAP GUI Scripting. I use the x64 version and after a while I noted that SAP GUI Scripting works without any problems. So I checked the access to the SAP GUI Scripting API from PowerShell x64, AutoIt x64 and VBScript x64 and in all cases it works perfect. I assumee that this possibility came with one of the newer patch levels of SAP GUI for Windows 7.40. So far it was necessary to use always x86 applications.

In the image below an example with PowerShell ISE x64.

In the image below the same PowerShell example with Visual Studio Code x64.

In the image below an example with AutoIt x64 and Scripting Tracker.

Good to know and a great thanks to the developer team.

7 Comments
You must be Logged on to comment or reply to a post.
    • Hello Stefan,

      Thanks for giving support for x64 OS.

      Is this will work with Java Com Automation as well ?

      Which SAP GUI front end software i require and how can i download / get that ?

      I want to integrate SAP Gui scripting using Java and JNI wrapper. So Kindly provide me your valuable inputs.

      • Hello Hasmukh,

        you need access to running object table (ROT) to get the SAPGUI object. If you can realize this with your x64 Java COM automation you should be able to use SAP GUI Scripting. And you need the SAP GUI for Windows, use an actual version 7.50 PL 9. You can download it from SAP support portal.

        Let us know your results.

        Best regards
        Stefan

         

  • Hi Stefan,

     

    First up, echo’ing Joachim, your work on here is unreal! Thank you for all the effort you put in.

     

    For the x64 apps, I guess this update doesn’t include Microsoft Office 2016?

     

    I saw the 32bit to 64bit workaround thread, the problem I face is approximately 30 users with no admin rights, so I’m wondering if the x64 doesn’t apply to Office 2016, would there be another way to deploy the workaround to all users?

    Thanks,

     

    James

    • Hello James,

      this works also with VBA from Microsoft Office x64. I tried it with Office 2013 x64 and it works in my case without any problems. I assume it should work in Office 2016 also,

      Cheers
      Stefan

      '-Begin-----------------------------------------------------------------
      
        '-Directives----------------------------------------------------------
        Option Explicit
      
        '-Main----------------------------------------------------------------
        Sub Main()
          
          Dim SapGuiAuto As Object
          Dim App As SAPFEWSELib.GuiApplication
          Dim connection As SAPFEWSELib.GuiConnection
          Dim session As SAPFEWSELib.GuiSession
          Dim Is64Bit As Boolean
          
          If App Is Nothing Then
            Set SapGuiAuto = GetObject("SAPGUI")
            Set App = SapGuiAuto.GetScriptingEngine
          End If
      
          If connection Is Nothing Then
            Set connection = App.Children(0)
          End If
      
          If session Is Nothing Then
            Set session = connection.Children(0)
          End If
          
          Debug.Print Application.OperatingSystem
          #If Win64 Then
            Is64Bit = True
          #End If
          Debug.Print Is64Bit
          Debug.Print session.Name
          
          
        End Sub
      
      '-End-------------------------------------------------------------------