Hello,
I have excel macro which should open and log in into my SAP but appaer the error message "Run-time error 438 Object doesn't support this property or method"
Here is the code which I am using
The error start on :
would you know what I am missing?
regards,
I have excel macro which should open and log in into my SAP but appaer the error message "Run-time error 438 Object doesn't support this property or method"
Here is the code which I am using
Rich (BB code):
Sub Vendors_to_IC_statement()
Dim pword As String
pword = InputBox("Please enter your password to SAP FP3", "Password Required", "*******")
User = Sheet4.Range("i1").Value = Environ("Username")
If Not IsObject(SapGuiApp) Then
Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If Not IsObject(Connection) Then
Set Connection = SapGuiApp.OpenConnection("FP3", False)
End If
If Not IsObject(Session) Then
Set Session = Connection.Children(0)
End If
'Login to SAP
Session.FindById("wnd[0]/usr/txtRSYST-MANDT").Text = "010"
Session.FindById("wnd[0]/usr/txtRSYST-BNAME").Text = User
Session.FindById("wnd[0]/usr/pwdRSYST-BCODE").Text = pword
Session.FindById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
Session.FindById("wnd[0]/usr/txtRSYST-LANGU").SetFocus
Session.FindById("wnd[0]/usr/txtRSYST-LANGU").caretPosition = 2
Session.FindById("wnd[0]").sendVKey 0
pword = ""
MsgBox "If you click on the OK button, the SAP session is terminated."
End Sub
Rich (BB code):
Session.FindById("wnd[0]/usr/txtRSYST-MANDT").Text = "010"
would you know what I am missing?
regards,
Last edited by a moderator: