Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Run-Time Error 91 for Internet Explorer .elements(name).value

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Run-Time Error 91 for Internet Explorer .elements(name).value

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
<thCcy</th
<th1 GBP =</th
</tr
<tr
<tdAED</td
<td<input type="text" class="rate"
name="rates[AED]"
value="6.8026" /</td <==
VALUE TO GET
</tr

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Run-Time Error 91 for Internet Explorer .elements(name).value

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
<thCcy</th
<th1 GBP =</th
</tr
<tr
<tdAED</td
<td<input type="text" class="rate"
name="rates[AED]"
value="6.8026" /</td <==
VALUE TO GET
</tr

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Run-Time Error 91 for Internet Explorer .elements(name).value

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer da Excel Discussion (Misc queries) 4 October 9th 08 09:31 PM
internet explorer instance Manoj Excel Discussion (Misc queries) 0 February 1st 06 09:56 AM
error in script from internet explorer fred6529 Excel Discussion (Misc queries) 0 June 11th 05 08:43 PM
Interaction with Internet Explorer PaulD Excel Programming 7 February 5th 05 07:27 PM
internet explorer doris Excel Discussion (Misc queries) 1 January 5th 05 09:44 PM


All times are GMT +1. The time now is 04:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"