Forum Discussion

mesg2anil's avatar
mesg2anil
Regular Contributor
14 years ago

The Combo Box Item Not Found Error

Hi,



I'm trying to execute the below code by calling excel file and using the str to input the data from excel to web application... I'm getting "The Combo box item not found" error...



Dim str, arrStr

str = ReadDataFromExcel() 'This is calling my excel file correctly

arrStr = Split(str,":")



'Enter land owner details from excel to application below


Call Mainmenu.Item("cboPaymentFor").ClickItem(arrStr(0))

Call Mainmenu.Item("cboProperty").ClickItem(arrStr(1)) 'PName



Clickitem dont work in this situation or should i use something else?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    ClickItem takes either an integer value indicating the index position in the select box or a text string that corresponds to the same item.  If your values in arrStr are not EXACTLY what is in the item list for your select box, you will get that error.  You need to make sure that no hidden characters are in the text in your combo box and that there are exact matches, including case sensitivity.
  • mesg2anil's avatar
    mesg2anil
    Regular Contributor
    Hi Robert,



    Thanks for the reply...

    I have various values in the arrstr, for ex: date, amount, name etc... in this situation, how to use the arrstr to input the data into the application?
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You're using it correctly, that's the thing... however, your question is why the item is not found... the item is not found because the string you're passing in to the "ClickItem" method does not match the strings in the drop down box.  Hence the need to investigate and compare the values to make sure the string you're passing in matches the a string in the drop down.
  • mesg2anil's avatar
    mesg2anil
    Regular Contributor
    Hi Robert,



    thanks for the comments...

    I was using some next line Chr(13) in the loop which was creating the problem... I removed it and it is working fine now...!! :)