lpan131313
New Member
- Joined
- Jan 30, 2019
- Messages
- 1
Hello All,
I'm hoping someone can help. I amtrying to create a macro using excel that will reference an already openinternet explorer tab and choose from dropdowns (they appear to be comboboxes).If it is relevant, it is an erp site. The website ishttps://ep.erp.navy.mil/irj/portal. I have some code that will check that thepage is open but won't run the rest of the code. Here is the code so far:
I'm hoping someone can help. I amtrying to create a macro using excel that will reference an already openinternet explorer tab and choose from dropdowns (they appear to be comboboxes).If it is relevant, it is an erp site. The website ishttps://ep.erp.navy.mil/irj/portal. I have some code that will check that thepage is open but won't run the rest of the code. Here is the code so far:
Code:
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]Sub ietest5()
Const myPageTitle As String = "SAP"
Const myPageURL As String = "https://ep.erp.navy.mil/irj/portal"
Const mySearchForm As String = "DROPDOWN_ITEM_15_AcDDLBase_combobox-r"
Const mySearchInput As String = "DROPDOWN_ITEM_15_AcDDLBase_combobox"
Const mySearchTerm As String = "Document Object Model"
Const myButton As String = "Go"
Dim myIE As SHDocVw.InternetExplorer
Dim ieDoc As Object
'check if page is already open
Set myIE = GetOpenIEByTitle(myPageTitle, False)
If myIE Is Nothing Then
'page isn't open yet
'create new IE instance
Set myIE = GetNewIE
'make IE window visible
myIE.Visible = True
'load page
If LoadWebPage(myIE, myPageURL) = False Then
'page wasn't loaded
MsgBox "Couldn't open page"
Exit Sub
End If
End If
With myIE.Document.form(mySearchForm) 'enter search term in text field
.elements(mySearchInput).Value = "Simulation"
'press button "Go"
' .elements(myButton).Click
End With
End Sub
Other code i was trying to use is:
'ieDoc.getElementById("DROPDOWN_ITEM_15_AcDDLBase_combobox").Focus
'ieDoc.getElementById("DROPDOWN_ITEM_15_AcDDLBase_combobox").Value = "Simulation".
[\code]
I don't know how to paste the source code