I need Excel to tell me if the button below called "Attachment List" is available to click or not, but I couldn't get it. Below is the code I tried:
Sub teste()
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApplication = SapGuiAuto.GetScriptingEngine
Set SAPConnection = SAPApplication.Children(0)
Set session = SAPConnection.Children(0)
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nme53n"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]").sendVKey 17
session.findById("wnd[1]/usr/subSUB0:SAPLMEGUI:0003/ctxtMEPO_SELECT-BANFN").Text = "Purchase Requisition"
session.findById("wnd[1]/usr/subSUB0:SAPLMEGUI:0003/ctxtMEPO_SELECT-BANFN").caretPosition = 8
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[0]/titl/shellcont/shell").pressContextButton "%GOS_TOOLBOX"
Set botao = session.findById("/app/con[0]/ses[0]/wnd[0]/titl/shellcont/shell/")
End Sub
I set "botao" to get all the 8 button data from the list on the image, but none of the properties helped me.
I need something like this:
attach = botao.CurrentContextMenu.Children.Item(2).isfocused
The code botao.CurrentContextMenu.Children.Item(2)
leads me to the "Attachment List" button, but no property was valuable to help me.
I REALLY need help with this.