Jump to content
Sign in to follow this  
JakubKonvalina

Select from combobox

Recommended Posts

JakubKonvalina

Hi I try select option from combobox. I tried many of recomended ways but no one of them works.

List of ways I try:

;$hControl = ControlGetHandle("[TITLE:Aplikace]", "", "[NAME:maritalStatusComboBox]")
;ControlCommand("[TITLE:Aplikace]","",$hControl,"SelectString", "Partner")

;$hWindow = WinGetHandle("[TITLE:Aplikace]")
;$hControl = ControlGetHandle($hWindow, "", "[NAME:maritalStatusComboBox]")
;ControlCommand($hWindow, "", $hControl, "SelectString", "Partner") ; Change this

;ControlCommand("[TITLE:Aplikace]","","[NAME:vehicleOwnerYesRadioButton]","Check")
;ControlGetHandle("[TITLE:Aplikace]", "", "[NAME:maritalStatusComboBox]")
;ControlCommand("[TITLE:Aplikace]", "", "[NAME:maritalStatusComboBox]", "ShowDropDown", "")
;ControlCommand("[TITLE:Aplikace]", "", "[NAME:maritalStatusComboBox]", "SelectString", 'Partner')
;ControlCommand("[TITLE:Aplikace]", "", "[NAME:maritalStatusComboBox]", "SetCurrentSelection", 2)

;ControlCommand('[CLASS:WindowsForms10.Window.8.app.0.378734a]','','[CLASS:WindowsForms10.COMBOBOX.app.0.378734a;INSTANCE:5]',"SetCurrentSelection", 4)


;ControlCommand("[TITLE:Aplikace]", "", "[NAME:employmentStatusComboBox]", "ShowDropDown", "")
;ControlSend("[TITLE:Aplikace]", "", "[NAME:employmentStatusComboBox]", "DP")
;sleep(1500)
;guictrlsetdata("[NAME:employmentStatusComboBox]", "DPP")

 _GUICtrlComboBox_SelectString("[CLASS:WindowsForms10.COMBOBOX.app.0.378734a;INSTANCE:8]", "DPP")

Do you anybody have suggestion what is wrong?

I need fill form in app by data from excel. I have functional textbox and radio button filling but combo still resists. 
Thanks

Share this post


Link to post
Share on other sites
Earthshine

Use the Excel UDFs. This is a Windows Forms, you won't be able to talk to it like Win32 controls. @water has written a lot of Excel and Outlooks stuff

 

https://www.autoitscript.com/wiki/Excel_UDF

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
jdelaney

Start small. Use wingethandle and verify you get the proper handle. Then use controlgethandle and verify you can find the combo, first. Pass those handles directly to the other functions to manipulate the control. Also add logging so you can give us something concrete, else we can only guess what you are seeing. Throw in the spy tool output for the control, also.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
JakubKonvalina

Hi thanks for your advice.

@Earthshine - combo is in windows  app. Do I understand correctly that your advice is directed to solve problem with combo in excel?

@jdelaney - I guess I get correct handle with combobox, because dropdown for it works correct. Am I right?
What exactly do you mean by logging? I can't find log function in AutoIt itself.

I can make log fnc myself, but actualy only thing what  I want from script is run app and select option from combo.

 

Share this post


Link to post
Share on other sites
Earthshine

my point is autoit can't manipulate WinForms like it can Win32 stuff. well, you can, but you need to do it differently

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×