hi all
I have the below code and opens a webpage fills out the information and submits and works great, ideally I want it to open a different page once this is done, how can I get it to input a new website into the address bar and open this?
I have the below code and opens a webpage fills out the information and submits and works great, ideally I want it to open a different page once this is done, how can I get it to input a new website into the address bar and open this?
Code:
Public Function FUNC_ChangeDetailsl()
'Input data into Niche
Dim IE As Object
'Create InternetExplorer Object
Set IE = New InternetExplorerMedium
With IE
.Visible = True
.navigate "http://FRG/ChangeREF.asp?headerid=" & Mid([Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_ItemDetails].[Form]![OrderRef], 3, 8)
End With
For Each win In CreateObject("Shell.Application").Windows
If win.Name Like "*Internet Explorer" Then
Set IE = win: Exit For
End If
Next
'Wait for IE to load
With IE
Do Until .ReadyState = 4
DoEvents
Loop
'Input Data Into IE
Set oDoc = IE.Document
'Red Seal
oDoc.getElementsByName("NewREF").Item(0).Value = ([Forms]![FRM_TBLALL_FullDetails]![SFRM_TBLALL_ItemDetails].[Form]![OrderREF], 2, 7)
oDoc.getElementsByName("Reason").Item(0).Value = "New Order"
' oDoc.all.Item("B1").Click
' oDoc.getElementsByTagName("B1")(0).Click
End With
'*open new page
End Function