Skip to Content

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.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. James Bowman

    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

    (0) 
    1. Stefan Schnell Post author

      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-------------------------------------------------------------------
      (0) 

Leave a Reply