on 02-16-2016 12:21 AM
Hello Stefan,
First I would like to congratulate you for the excellent application "Tracker".
In short time of use could already get good results, thank you.
But today when trying to write a script I'm not identify the name of the vertical scroll bar on the transaction QM02, could you help me please.
Thank you.
Hello Marcio,
welcome in the Scripting Language forum.
The vertical scrollbar you are looking for has no own ID, it is part of the user screen - hope you mean this scrollbar.
Here an example code:
'-Begin-----------------------------------------------------------------
'-Directives----------------------------------------------------------
Option Explicit
'-Global Variables----------------------------------------------------
Dim SapGuiAuto, application, connection, session
Dim UserArea, VScrlBar
'-Main----------------------------------------------------------------
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
Set UserArea = session.FindById("wnd[0]/usr")
Set VScrlBar = UserArea.VerticalScrollbar
MsgBox CStr(VScrlBar.Minimum) & vbCrLf & _
CStr(VScrlBar.Maximum) & vbCrLf & _
CStr(VScrlBar.PageSize) & vbCrLf & _
CStr(VScrlBar.Position)
'-End-------------------------------------------------------------------
You can set the position of the scrollbar e.g. like this
VScrlBar.Position = 106
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stefan!
Worked perfectly! Now I'm able to control the position of the vertical scroll bar.
* To run your script is presenting a syntax error, regardless, I took parts of the code.
Thank you so much!
Excuse me if some sentences are not concordances, my English is very basic. I'm using Google Translator.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.