on 04-19-2006 2:55 PM
I try to write VB.NET application using SAP GUI Scripting classes. Two first lines of the code below attaches SAPLogOn to the script. It works OK. When I try to set object "connection" ( third line)I receive an error.
"An unhandled exception of type 'System.InvalidCastException' occurred.Specified cast is not valid"
SapGuiAuto = GetObject("SAPGUI")
application = SapGuiAuto.GetScriptingEngine
connection = application.Children
Maybe somebody knows how to write that code properly?
In VB6 there is no problem. Third line looks like:
connection = application.Children(0)
I wrote those lines and they works
SapGuiAuto = GetObject("SAPGUI")
application = SapGuiAuto.GetScriptingEngine
connection = application.OpenConnection(<<System Name String>>, True, False)
session= connection.Children.Item(0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.