on 06-26-2015 9:16 PM
Hi, I got a problem running my VBA code within Excel. Before I have no problem connecting to SAP 730 using set sapguiauto=getobject("SAPGUI") but after our IT upgrade to sapgui for windows 740 I could not execute the code with Automation error and invalid syntax and I did a lot of research and testing and just could not find the solution. I am using these codes in every part of my running program in SAP 730 with no problems.
Sub test()
Dim App, Connection, session As Object
Set sapguiauto = GetObject("SAPGUI")
Set App = sapguiauto.GetScriptingEngine
Set Connection = App.Children(0)
Set session = Connection.Children(0)
End Sub
Would really appreciate your help. Thanks
Hi Art
First of all you should learn about Variables and their declaration
Doing this:
Dim App,Connection, Session as Object
only declares session as Object.
App and Connection are Variants
To avoid this you can tell VBA with an Option Explicit at the beginning of Code that all variables must be declared (Dim).
Next thing I would do is to debug your code (F8) and step it through...
To do so mark the first line of Code and press F9 to create a Stop-Mark
Now you can evtl.see where the trouble is
PS:
What evtl comes to my mind () is your SAP System local installed or do you have to connect (for example) via Citrix
greetings
Thomas B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.