<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Login SAP system using excel macro in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/login-sap-system-using-excel-macro/qaa-p/467593#M76722</link>
    <description>&lt;P&gt;Hello NG,&lt;/P&gt;
  &lt;P&gt;do you use x64 version of Office, this could be one reason. I checked it with SAP GUI for Windows 7.40 PL12 and 7.50 PL0, it works with x86 but not with x64 version.&lt;/P&gt;
  &lt;P&gt;Let us know.&lt;/P&gt;
  &lt;P&gt;Best regards&lt;BR /&gt;Stefa&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2017 06:01:29 GMT</pubDate>
    <dc:creator>Stefan-Schnell</dc:creator>
    <dc:date>2017-08-18T06:01:29Z</dc:date>
    <item>
      <title>Login SAP system using excel macro</title>
      <link>https://community.sap.com/t5/technology-q-a/login-sap-system-using-excel-macro/qaq-p/467592</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Hi Experts,


Trying below mention Code in VBA for Login in SAP
After adding library SAP: Remote Function Call: COM support 1.0 Type Library into VBA

But getting error while running :- "RUN TIME Error '429'
Active X Component can't create object

On debugging showing error in Line 2 " Set sap = CreateObject("SAP.Functions")"


** Please let me know this code also works when user is already Login In SAP**

Dim sap As Object
Dim conn As Object

&amp;gt;&amp;gt; Sub T_login()
&amp;gt;&amp;gt; Set sap = CreateObject("SAP.Functions")
&amp;gt;&amp;gt; Set conn = sap.Connection
&amp;gt;&amp;gt; conn.System = "GEQ"
&amp;gt;&amp;gt; conn.client = "210"
&amp;gt;&amp;gt; conn.user = "n.g"
&amp;gt;&amp;gt; conn.Password = "iel.789"
&amp;gt;&amp;gt; conn.Language = "EN"
&amp;gt;&amp;gt; If conn.logon(0, False) &amp;lt;&amp;gt; True Then
&amp;gt;&amp;gt; MsgBox "Logon to the SAP system is not possible", vbOKOnly, "Comment"
&amp;gt;&amp;gt; Else
&amp;gt;&amp;gt; End If
&amp;gt;&amp;gt; If Not IsObject(SAPguiApp) Then
&amp;gt;&amp;gt; Set SAPguiApp = CreateObject("Sapgui.ScriptingCtrl.1")
&amp;gt;&amp;gt; End If
&amp;gt;&amp;gt; If Not IsObject(Connection) Then
&amp;gt;&amp;gt; Set Connection = SAPguiApp.OpenConnection("SYSTEM", True)
&amp;gt;&amp;gt; End If
&amp;gt;&amp;gt; If Not IsObject(session) Then
&amp;gt;&amp;gt; Set session = Connection.Children(0)
&amp;gt;&amp;gt; End If
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "CLIENT"
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "USER"
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "PASSWORD"
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/txtRSYST-LANGU").SetFocus
&amp;gt;&amp;gt; session.findById("wnd[0]/usr/txtRSYST-LANGU").caretPosition = 2
&amp;gt;&amp;gt; session.findById("wnd[0]").sendVKey 0
&amp;gt;&amp;gt; Set wshell = CreateObject("Wscript.Shell")
&amp;gt;&amp;gt; wshell.Run Chr(34) &amp;amp; Path &amp;amp; "\script.vbs" &amp;amp; Chr(34), 1, 1
&amp;gt;&amp;gt; End Sub&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:43:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/login-sap-system-using-excel-macro/qaq-p/467592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-08-17T12:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Login SAP system using excel macro</title>
      <link>https://community.sap.com/t5/technology-q-a/login-sap-system-using-excel-macro/qaa-p/467593#M76722</link>
      <description>&lt;P&gt;Hello NG,&lt;/P&gt;
  &lt;P&gt;do you use x64 version of Office, this could be one reason. I checked it with SAP GUI for Windows 7.40 PL12 and 7.50 PL0, it works with x86 but not with x64 version.&lt;/P&gt;
  &lt;P&gt;Let us know.&lt;/P&gt;
  &lt;P&gt;Best regards&lt;BR /&gt;Stefa&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 06:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/login-sap-system-using-excel-macro/qaa-p/467593#M76722</guid>
      <dc:creator>Stefan-Schnell</dc:creator>
      <dc:date>2017-08-18T06:01:29Z</dc:date>
    </item>
  </channel>
</rss>

