cancel
Showing results for 
Search instead for 
Did you mean: 

Export of report from SAP to Excel 2013 (the enumeration of the collection cannot find an element with the specified index)

Former Member
0 Kudos

Hi Experts,

Greetings!

I am new to SAP and I have recorded a script for extracting a report from SAP to Excel.  It was working fine till yesterday, however I am getting error.  Kindly guide me in resolving this issue.

Please find below the coding.

If Not IsObject(Application) Then

Set SapGuiAuto = GetObject("SAPGUI")

Set Object = SapGuiAuto.GetScriptingEngine

End If

If Not IsObject(Connection) Then

Set Connection = Object.Children(0)

End If

If Not IsObject(session) Then

Set session = Connection.Children(0) - (Error is appearing at this stage of the macro)

End If

If IsObject(WScript) Then

WScript.ConnectObject session, "on"

WScript.ConnectObject Object, "on"

End If

Thanks in advance.

Regards

Balaji R K

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I am new to SAP as well and i am getting the same error. Scripting is activated in VBA Editor and in SAP GUI. Can somebody help please?

Best regards

Steffen

Former Member
0 Kudos

I am now receiving the same error. Used to work earlier. Were you able to find a solution to the same ? If so, can you please share ?

Thanks