excel vba - RUN VBS SAP from VBA Object required error -


i'm trying write macro start vbs sap script , possible change of variables of vbs code. great! below object required error

public sub simplesapexport() set sapguiauto = getobject("sapgui")  'get sap gui scripting object set sapapp = sapguiauto.getscriptingengine 'get running sap gui set sapcon = sapapp.children(0) 'get first system connected set session = connection.children(0) 'get first session (window) on connection  '  start transaction view table session.starttransaction "se16" end sub 

try code:

set sapguiauto = getobject("sapgui") 'get sap gui scripting object set sapapp = sapguiauto.getscriptingengine 'get running sap gui set sapcon = sapapp.children(0) 'get first system connected set session = sapcon.children(0) 'get first session (window) on connection 

you getting error message because missing object sapcon in istead of connection, chance object , execute code, facing same issue , solved changing object.

best,

edgar m.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -