0

I'm having the following problem which is once I populate some inputbox on IE with information from Excel using VBA, these are populated correctly but when i change onto the second line with input boxes (they all are the same in format) the one I filled before does not get saved (even if I press save).. the only way I found for the information to remain is if I get into any of these boxes I'm filling and type something manually.

Anyone has an idea of why this might be?

Thanks!

For Each cell In wsbd.range(range("A6"), range("A6").End(xlDown))
  additemsbtn.Click
  Set aNodeList = ieDoc.querySelectorAll("[dojoinsertionindex]")
      aNodeList.Item(0).Click
  For i = 0 To 15
    If ieDoc.getElementById("meetingResultsPlanningTable").getElementsByTagName("select")(0).Item(i).innerText = wsbd.range("A6").Value Then
      ieDoc.getElementById("meetingResultsPlanningTable").getElementsByTagName("select")(0).Item(i).Selected = True
      Exit For
    End If
  Next i
  
Set dropOptions = ieDoc.getElementById("meetingResultsPlanningTable").getElementsByTagName("select")(5)
    dropOptions.Value = "Value"
    
Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("InputBox")(0)
    itemName.Value = wsbd.range("F6").Value
    
Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("NumInputBox2")(0)
    itemName.Value = wsbd.range("J6").Value
    
Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("NumInputBox")(0)
    itemName.Value = wsbd.range("Q6").Value

Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("NumInputBox")(1)
    itemName.Value = wsbd.range("T6").Value * 100
    
Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("NumInputBox")(1)
    itemName.Value = itemName.Value + 0
    
'Set savebtn = ieDoc.getElementById("/images/buttons/save.gif")
' savebtn.Click

Next cell

The code is working and is reading properly all the inofrmation in Excel, finding the corresponding Input boxes and populating them but then nothing gets saved or recorded.. as you can see I tried saving after completing the boxes but it still doesn't work...

Pablo G
  • 199
  • 12
  • 1
    Please share the HTML in question using the snippet tool provided (icon looks like a document with <> on). Include an URL if possible and show the code you have so far and explain what isn't working. – QHarr Aug 20 '18 at 11:45
  • Take a look at answers for [this question](https://stackoverflow.com/q/48611570/2165759). – omegastripes Aug 20 '18 at 12:40
  • @QHarr I added the code but can't add the URL.. – Pablo G Aug 22 '18 at 09:20
  • @omegastripes thanks! it seems that thread had a similar problem to the one I have. I'll get to it to see if I can find a solution – Pablo G Aug 22 '18 at 09:23

1 Answers1

0

I came up with a solution! And pretty simple by the way.. I just added a fireevent ("onchange") for each input box and that records all changes!

Set itemName = ieDoc.getElementById("dynamicLineItems").getElementsByClassName("InputBox")(0)
    itemName.Focus
    itemName.FireEvent ("onchange")
    itemName.Value = somevalue.Value
Pablo G
  • 199
  • 12