PC Review


Reply
Thread Tools Rate Thread

Run-Time Error 91 for Internet Explorer .elements(name).value

 
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      24th Oct 2006
Hi,

Can anyone provide some advice as to why the line marked "ERROR" below
results in a Run-time error 91?

I know it relates to .elements(nm).Value. I've successfully tested to
see if I can hard-code the name and debug.print the value. However it
won't accept a built-up string (nm).

Sub Test()

Set IeApp = New InternetExplorer
IeApp.Visible = True
IeApp.Navigate "http://www.mywebsite.com"
Do: Loop Until IeApp.ReadyState = READYSTATE_COMPLETE

With IeApp.Document.forms("form")
For Each cell In rng
nm = "rates[" & cell & "]"
cell.Offset(0, 1) = .elements(nm).Value <== ERROR
Next cell
End With

End Sub

Many thanks in advance if anyone can provide some advice.
Regards,
Chris Adams

 
Reply With Quote
 
 
 
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      24th Oct 2006
Btw, below is the HTML code that I'm trying to extract the value from.
Basically, its a table with boxes populated by numbers, and I'm trying
to get the numbers.

<table class="layout">
<tr>
<td class="layout" valign="top">
<table>
<tr>
<th>Ccy</th>
<th>1 GBP =</th>
</tr>
<tr>
<td>AED</td>
<td><input type="text" class="rate"
name="rates[AED]"
value="6.8026" /></td> <==
VALUE TO GET
</tr>

 
Reply With Quote
 
 
 
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      24th Oct 2006
Btw, below is the HTML code that I'm trying to extract the value from.
Basically, its a table with boxes populated by numbers, and I'm trying
to get the numbers.

<table class="layout">
<tr>
<td class="layout" valign="top">
<table>
<tr>
<th>Ccy</th>
<th>1 GBP =</th>
</tr>
<tr>
<td>AED</td>
<td><input type="text" class="rate"
name="rates[AED]"
value="6.8026" /></td> <==
VALUE TO GET
</tr>

 
Reply With Quote
 
chris_j_adams@hotmail.com
Guest
Posts: n/a
 
      24th Oct 2006
For what its worth, I've fashioned a workaround, less elegant but its
working so far. I loop through the table and push the values back to
Excel. Here's the code.

With IeApp.Document.forms("form")
r = .elements.Length - 3
For i = 1 To r
ccy = Mid(.elements(i).Name, 7, 3)
ccyVal = .elements(i).Value
Set rngCCY = rng.Find(ccy)
rngCCY.Offset(0, 1) = ccyVal
Next i
End With

Thanks to those who took the time to check it out anyway.
Regards,
Chris Adams

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet explorer and windows explorer lock up when Internet explorer menu bar is used David D. Pettyjohn Windows XP Help 1 16th Dec 2007 06:14 AM
Windows Explorer Error And Internet Explorer Error-Please Helpp!!! =?Utf-8?B?V2luZG93cyBBbmQgSW50ZXJuZXQgRXhwbG9yZXIg Windows XP General 1 11th May 2005 09:19 AM
winows explorer error and internet explorer error messages =?Utf-8?B?bnZteTcyZGFydA==?= Windows XP Help 1 7th Dec 2004 05:16 AM
Saving Web pages in Internet Explorer as .mht causes Internet Explorer to crash M Windows XP General 3 7th Nov 2004 07:22 PM
Internet Explorer 7 OR Internet Explorer .NET Ranji Narine Windows XP Internet Explorer 1 25th Jul 2003 04:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:27 PM.