Quantcast
Channel: SCN : All Content - Scripting Languages
Viewing all articles
Browse latest Browse all 522

Problem with SAP logon by VBA

$
0
0

Hi, I'm new in the community and I'm also new with SAP, so sorry for any errors.

For my work I need to open SAP by excel (VBA); and I have found the code below but it don't work.

 

 

Sub Work()

Set app = CreateObject("Sapgui.ScriptingCtrl.1")

Set Connection = app.openconnection("my system", True)

Set session = Connection.Children(0)

session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "Client"

session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "User"

session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "Password"

session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "Language"

Session.findById("wnd[0]").sendVKey 0

End Sub

 

 

When the macro runs there is this error  

 

Can you help me?

Thank you,

ax_salerno


Viewing all articles
Browse latest Browse all 522

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>