PDA

View Full Version : Fill Internet Form



ommeidh
03-13-2018, 01:48 PM
I am having some troubles running a few lines of VBA. Here is what I have so far.


Sub FillInternetForm()
Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use Reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.

IE.Navigate "https://app.hubspot.com/sales/4267135/deal/265175492/?interaction=note"
'go to web page listed inside quotes
IE.Visible = True

While IE.busy
DoEvents 'wait until IE is done loading page.
Wend

IE.Document.All("percentage_to_close").Click
IE.Document.All("percentage_to_close").Value = ThisWorkbook.Sheets("sheet2").Range(F35)
End Sub




My goal is to take the numeric value in cell F35, and place it into the field on IE9. However, when I run this, it comes back with an Error 424 'object required'

When I run the script without the "IE.Document.All("percentage_to_close").Click" the error I receive is an Error 9 "Subscript out of range" So I assume I have to direct the script towards the button that allows me to edit this field, hence the .Click.

However, when I inspect the elements of the page, the name for the button does not appear, I don't see it referencing a button name, just the class, the style, etc.

Below is a dropbox link that contains a screen shot of the form and a screenshot of the elements view on Google Chrome.

https://www.dropbox.com/sh/wmseo3dhl0yr01v/AAAz6TdbVDvubMSM4drW0z-Aa?dl=0

SamT
03-17-2018, 01:44 PM
Moderator Bump