SAP-Forum.ORG
   
This web site isn't affiliated with, sponsored by, or approved by SAP AG. Is only a SAP users community.

Go Back   SAP-Forum.ORG > SAP Forums > SAPScript - Smartforms

Similar Threads
Thread Thread Starter Forum Replies Last Post
XL Reporter Error - Error Starting Excel! Cause: (Retrieve Excel Interface) Lala SBO - SAP Business One 2 05-13-2011 06:59 PM
HU items' material posting is inconsistent - Error Message HUGENERAL327 Micro SAP SD - Sales & Distribution 1 04-19-2011 09:43 PM
Error Message KI339 ERP SAP FI CO - Financials and Controlling 1 01-26-2011 09:10 PM
RS_VARIANT_CONTENTS - Message Error : "Obsolete variants". Pepa SAP ABAP 2 08-30-2010 02:16 PM
Call transaction background mode + error message DC006 Control framework Lala SAP ABAP 2 08-27-2010 01:45 PM

Aprenda SAP!
Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2011, 09:16 PM
Rampa Rampa is offline
Senior Member
 
Join Date: May 2010
Location: Utah
Posts: 197
Default Excel Macro - GuiXT error message

Hello experts,

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 in advance,
Rampa
Reply With Quote
Sponsors
  #2  
Old 08-17-2011, 09:18 PM
Golfi Golfi is offline
Senior Member
 
Join Date: May 2010
Location: Delaware
Posts: 824
Default Re: Excel Macro - GuiXT error message

Hi Rampa,

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:
Code:
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:
Code:
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,
Golfi
Reply With Quote
Entre a los Links relacionados
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:14 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum Design By inferno