Hi Guys,
I need some help with my script below. I have no issues with part one of the script until when it starts going to the 2nd URL. I'll like the following to be done:
1. I'll like the "Live1" option to be selected.
2. The text to be copied and inserted from excel
3. From the masterIB select option value 1 and it mus be able to allow the server to connect, to load, before we can head to 4.
4. to paste the selection in from the server
Somehow the 2nd part of the script starts having error, i'm using IE 11 currently and excel 2013
<select name="serverName" tabindex="-1" id="serverName" style="display: none;"> <option value="-1">-Select Server-</option><option value="Live">Live</option><option value="Live1">Live1</option><option value="Live2">Live2</option><option value="Live3">Live3</option> </select>
<select name="masterIB" tabindex="-1" id="masterIB" style="display: none;"> <option value="-1">-Select master IB-</option> <option value="1">ADSSecurities</option><option value="107">ADS London</option><option value="51">ADS.AD</option> </select>
<select name="childIB" tabindex="-1" id="childIB" style="display: none;" onchange="getSameLevelIB()"> <option value="-1">-Select child IB-</option> </select>
Thanks guys i seriously hope this can be done.
I need some help with my script below. I have no issues with part one of the script until when it starts going to the 2nd URL. I'll like the following to be done:
1. I'll like the "Live1" option to be selected.
2. The text to be copied and inserted from excel
3. From the masterIB select option value 1 and it mus be able to allow the server to connect, to load, before we can head to 4.
4. to paste the selection in from the server
Somehow the 2nd part of the script starts having error, i'm using IE 11 currently and excel 2013
<select name="serverName" tabindex="-1" id="serverName" style="display: none;"> <option value="-1">-Select Server-</option><option value="Live">Live</option><option value="Live1">Live1</option><option value="Live2">Live2</option><option value="Live3">Live3</option> </select>
Code:
<select name="serverName" tabindex="-1" id="serverName" style="display: none;">
<option value="-1">-Select Server-</option><option value="Live">Live</option><option value="Live1">Live1</option><option value="Live2">Live2</option><option value="Live3">Live3</option> </select>
<input name="profilename" class="inputtext" id="profilename" type="text">
<select name="masterIB" tabindex="-1" id="masterIB" style="display: none;">
<option value="-1">-Select master IB-</option>
<option value="1">HSecurities</option><option value="107">HLondon</option><option value="51">HAD</option> </select>
<select name="childIB" tabindex="-1" id="childIB" style="display: none;" onchange="getSameLevelIB()">
<option value="-1">-Select child IB-</option>
</select>
<select name="masterIB" tabindex="-1" id="masterIB" style="display: none;"> <option value="-1">-Select master IB-</option> <option value="1">ADSSecurities</option><option value="107">ADS London</option><option value="51">ADS.AD</option> </select>
<select name="childIB" tabindex="-1" id="childIB" style="display: none;" onchange="getSameLevelIB()"> <option value="-1">-Select child IB-</option> </select>
Code:
Private Sub insert1() Set ie = CreateObject("InternetExplorer.Application")
my_url1 = "https://abc.com/admin/createib.php"
my_url2 = "https://abc.com/admin/createprofile.php"
With ie
.Visible = True
.Navigate my_url1
Do Until Not ie.Busy And ie.readyState = 4: DoEvents: Loop
End With
If InStr(ie.LocationURL, "login") > 0 Then
'Input the userid and password
ie.document.getElementById("login").Value = Sheets("PW").Range("B8")
ie.document.getElementById("password").Value = Sheets("PW").Range("C8")
ie.document.getElementById("login-btn").Click
Application.Wait (Now + TimeValue("0.00:03"))
ie.Navigate my_url1
Application.Wait (Now + TimeValue("0.00:03"))
End If
With ie.document
.getElementById("username").Value = Sheets("IB Profile").Range("B8")
.getElementById("password").Value = Sheets("IB Profile").Range("B11")
.getElementById("name").Value = Sheets("IB Profile").Range("B7")
.getElementById("lname").Value = " "
.getElementById("email").Value = Sheets("IB Profile").Range("B10")
.getElementById("ibcode").Value = Sheets("IB Profile").Range("B9")
.getElementById("region").Value = "Asia"
.getElementById("country").Value = Sheets("IB Profile").Range("C6")
.getElementById("currency").Value = "USD"
.getElementById("balance").Value = "0"
.getElementById("IB").Value = Sheets("IB Profile").Range("d6")
.getElementById("submitchanges").Click
End With
ie.Navigate my_url2, CLng(2048)
Application.Wait (Now + TimeValue("0.00:05"))
'Error starts from here
With ie.document
.getElementById("serverName").Value = "Live1"
.getElementById("profilename").Value = Sheets("IB Profile").Range("B8")
.getElementById("masterIB").Value = "HSecurities"
.getElementById("childIB").Value = "6684"
.getElementById("create").Click
End With
End Sub
Thanks guys i seriously hope this can be done.
Last edited: