JakubKonvalina Posted February 6, 2018 Share Posted February 6, 2018 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 Link to comment Share on other sites More sharing options...
Earthshine Posted February 6, 2018 Share Posted February 6, 2018 (edited) 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 February 6, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
jdelaney Posted February 6, 2018 Share Posted February 6, 2018 (edited) 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 February 6, 2018 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. Link to comment Share on other sites More sharing options...
JakubKonvalina Posted February 7, 2018 Author Share Posted February 7, 2018 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. Link to comment Share on other sites More sharing options...
jdelaney Posted February 7, 2018 Share Posted February 7, 2018 Consolewrite 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. Link to comment Share on other sites More sharing options...
Earthshine Posted February 7, 2018 Share Posted February 7, 2018 (edited) my point is autoit can't manipulate WinForms like it can Win32 stuff. well, you can, but you need to do it differently Edited February 7, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now