CharlesWhiteman
Registered User.
- Local time
- Today, 14:35
- Joined
- Feb 26, 2007
- Messages
- 421
Hi All, I am successfully using some code to open a web page and log in for me.
The bit I am really stuck on and still after reading various posts and googling I cannot seem to get a bit of code to read a value from the web page.
The (sample) source of the webpage looks like:
The code I found (http://www.access-programmers.co.uk/forums/showthread.php?t=176968)
showed me that the syntax to read a value is:
But I get a runtime error 438 object or method not supported
Any advice for this particularly tough to crack much appreciated.
Code:
Dim ieApp As InternetExplorer
Set ieApp = New InternetExplorer
ieApp.visible = True
ieApp.Navigate "https://" & Me.txtIPAddress & "/login.cgi"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.Document
With ieDoc.Forms(0)
.UserName.Value = "xxx"
.Password.Value = "yyy"
.submit
End With
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
The bit I am really stuck on and still after reading various posts and googling I cannot seem to get a bit of code to read a value from the web page.
The (sample) source of the webpage looks like:
<table border="0" cellpadding="0" cellspacing="0" class="linktable">
<tr><th colspan="2">Status</th></tr>
<tr><td valign="top" style="width: 50%">
<div class="fieldset" id="general_info">
<div id="hostinfo" class="row">
<span class="label">Device Name:</span>
<span class="value" id="hostname"> </span>
</div>
<div id="netmodeinfo" class="row">
<span class="label">Network Mode:</span>
<span class="value" id="netmode"> </span>
</div>
<div id="wmodeinfo" class="row">
<span class="label">Wireless Mode:</span>
<span class="value" id="wmode"> </span>
</div>
<div id="astatusinfo" class="row">
<span class="label">airView Status:</span>
<span class="value" id="astatus"> </span>
</div>
<div id="ssidinfo" class="row">
<span class="label" id="essid_label">SSID:</span>
<span class="value" id="essid"> </span>
</div>
The code I found (http://www.access-programmers.co.uk/forums/showthread.php?t=176968)
showed me that the syntax to read a value is:
Code:
ie.Document.getElementById("ssidinfo").Value
But I get a runtime error 438 object or method not supported
Any advice for this particularly tough to crack much appreciated.