0

Hoping someone might understand what might be going on. What I'm aiming for is using Excel VBA to open my PayPal Multi-Order Shipping page, then open the "Create Shipment" dialogue box and populate the basic name and address fields using data from a row in my excel spreadsheet. My current trouble is with clicking the "Create Shipment" button to open the dialogue box so I can populate the fields ... the code seems to ignore the GetElementByID("createNewOrder").click command and does absolutely nothing. Here's my code so far if anyone would care to take a look ... any help is much appreciated.

Sub PayPalMultiShip()

Dim IE As New SHDocVw.InternetExplorerMedium


IE.Visible = True
IE.Navigate ("https://www.paypal.com/shiplabel/createbulk")


Do While IE.ReadyState <> READYSTATE_COMPLETE
    DoEvents
Loop


IE.Document.getElementById("createNewOrder").click


Debug.Print "All Done"

End Sub

Here is a screenshot of the html code for the button that I'm trying to access ...

sceenshot

This screenshot comes from the Event Listener tab in the DOM Explorer ... Event Listener Screenshot I apologize, but since I'm new to the forum it won't allow me to embed pictures unless someone else suggests the edit

  • Please can you use the snippet tool via [edit] to add the relevant html. Also, inspect that element for any associated event listeners that may need to be fired and/or created. See: https://stackoverflow.com/questions/17795211/view-event-listeners-javascript, https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Examine_event_listeners, https://stackoverflow.com/questions/10213703/how-do-i-view-events-fired-on-an-element-in-chrome-devtools – QHarr Apr 02 '20 at 06:58
  • I've just added a screenshot of the html code .. see link in original post. – Chris Hilgendorf Apr 02 '20 at 15:36
  • If you click on the relevant html are there any associated event listeners? – QHarr Apr 02 '20 at 15:37
  • Thank you... I've added the event listener screenshot to the original post. – Chris Hilgendorf Apr 02 '20 at 19:50
  • There is nothing associated with it that says onclick or onblur, onclick etc......? – QHarr Apr 02 '20 at 20:04
  • I've modified the screenshot to show what I think you're asking about ... you'll see the "click" category about 50 rows above the "button" listener row. – Chris Hilgendorf Apr 03 '20 at 03:29
  • They would have button#createNewOrder in front and I can't see any in the screenshot. Try ie.document.parentWindow.execScript("document.querySelector('#createNewOrder').click();") – QHarr Apr 03 '20 at 04:20
  • The button#createNewOrder is there ... I changed the image back to just that code so it didn't get lost in the giant set of code. Just to clarify it is part of image access by the link entitled "Event Listener Screenshot". – Chris Hilgendorf Apr 03 '20 at 12:27

0 Answers0