cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error when creating GUISession

Former Member
0 Kudos

I m following this C# code to automate C#
SapROTWr.CSapROTWrapper sapROTWrapper = new SapROTWr.CSapROTWrapper();
object SapGuilRot = sapROTWrapper.GetROTEntry("SAPGUI");
object engine = SapGuilRot.GetType().InvokeMember("GetScriptingEngine", System.Reflection.BindingFlags.InvokeMethod, null, SapGuilRot, null);
GuiApplication GuiApp = (GuiApplication)engine;
GuiConnection connection = (GuiConnection)GuiApp.Connections.ElementAt(0);
GuiSession session = (GuiSession)connection.Children.ElementAt(0);

Initially it was working, but now i am getting error as The enumerator of the collection cannot find en element with the specified index. when i try to initialize to session object.

Using SAPLogOn 730 GUI

please help guide me to resolve it

Accepted Solutions (0)

Answers (0)