cancel
Showing results for 
Search instead for 
Did you mean: 

VBA run-time error '614'

tim_zhang
Explorer
0 Kudos

when i run above code the error pop up, in watch list, the object's children count is 0,

what happened?

Accepted Solutions (0)

Answers (2)

Answers (2)

tim_zhang
Explorer
0 Kudos

@Stefan Schnell,

i am sure i opened a session and the screen stay on

SESSION_MANAGER but the code still not work.

stefan_schnell
Active Contributor
0 Kudos

Hello Tim,

please use TAC SA38 with the program RSPARAM and look at the parameters sapgui/user_scripting, they must be set like this:

Best regards
Stefan

stefan_schnell
Active Contributor
0 Kudos

Hello Tim,

welcome in the SAP Community.

To use your code you must open an SAP session manually. With the code

Sub szz()

  Set SAPGuiAuto = GetObject("SAPGUI")
  Set SAPApplication = SAPGuiAuto.GetScriptingEngine
  Set SAPConnection = SAPApplication.Children(0)
  Set asession = SAPConnection.Children(0)

End Sub

you want to connect explicite to the connection 0 and the session 0, which means the first session of the first connection - counting starts at zero. If you open a session to an SAP system your code should work.

Best regards
Stefan