on 08-09-2011 10:08 PM
Hello,
When GuiXT is activated and the following script is executed from excel macro
Pop up message "Can not find GuiXT component, check the installation"is displayed.
When GuiXT is deactivated no error message is displayed.
What can be done to avoid this pop up ?
If Not IsObject(SapGuiApp) Then
Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
If Not IsObject(Connection) Then
Set Connection = SapGuiApp.OpenConnection("QA", False)
End If
If Not IsObject(Session) Then
Set Session = Connection.Children(0)
End If
If how = "maximize" Then
Session.findById("wnd[0]").maximize
Else
If how = "iconify" Then
Session.findById("wnd[0]").iconify
Else
Session.findById("wnd[0]").iconify
End If
End If
Session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "400"
Session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "USER"
Session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = "PASS"
Session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "EN"
Session.findById("wnd[0]/usr/txtRSYST-LANGU").SetFocus
Session.findById("wnd[0]/usr/txtRSYST-LANGU").caretPosition = 2
Session.findById("wnd[0]").sendVKey 0
......
Thanks,
Ziv
Hi Ziv,
The object "Sapgui.ScriptingCtrl.1" does not support the GuiXT. So the error does not come, you must first disable GuiXT. Or you can use a helper script.
For example:
set wshell = createObject("Wscript.Shell")
wshell.run "./script_activate.vbs Information"
If Not IsObject(SapGuiApp) Then
Set SapGuiApp = CreateObject("Sapgui.ScriptingCtrl.1")
End If
. . .
script_activate.vbs:
if wscript.arguments.count > 0 then
window_title = wscript.arguments(0)
set wshell = createobject("Wscript.Shell")
number = 0
Do
bWindowFound = Wshell.AppActivate(window_title)
WScript.Sleep 500
number = number + 1
if number > 10 then exit do
Loop Until bWindowFound
wscript.sleep 200
Wshell.AppActivate window_title
wscript.sleep 200
wshell.sendkeys "{Enter}"
wscript.sleep 200
end if
Regards,
ScriptMan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check the site http://www.synactive.com/docu_e/doc_installation.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.