473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

string variable in .elements( ).value doesn't work

Hi,

I'm trying to pull some values out of a table in IE using Excel 97.

This works:
IeApp.Document.forms("form").elements("rates[AUD]").Value

This doesn't:
nm = "rates[" & ccy & "]"
IeApp.Document.forms("form").elements(nm).Value

Can anyone shed any light on why it may not work please?
Btw, the code I'm trying to extract it from appears below.

Many thanks in advance for any advice/help.
Regards,
Chris Adams

<table class="layout">
<tr>
<td class="layout" valign="top">
<table>
<tr>
<th>Ccy</th>
<th>1 GBP =</th>
</tr>
<tr>
<td>AUD</td>
<td><input type="text" class="rate"
name="rates[AED]"
value="2.501" /></td <==VALUE
I WANT
</tr>

Oct 24 '06 #1
2 1316
ch***********@hotmail.com schrieb:
This works:
IeApp.Document.forms("form").elements("rates[AUD]").Value

This doesn't:
nm = "rates[" & ccy & "]"
IeApp.Document.forms("form").elements(nm).Value
What about
nm = "rates[" + ccy + "]"

Björn
Oct 24 '06 #2
Björn,

Many thanks for your advice. I tried that but unfortunately it didn't
work either. For what its worth, I've fashioned a workaround, which
is 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
Many thanks again for your help, much appreciated.
Regards,
Chris Adams

Oct 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Corey | last post by:
All, I am relatively new to XML and I have what may sound like a dumb question. I want to pass a query string variable to my xml document and filter the output based on that variable. For...
1
by: Wee | last post by:
String.value.length and String.value doesn't work together in a single function in IE. I've no problem running either of this, but not together at the same time. var...
12
by: harishg2 | last post by:
Hi, How to store a variable value for more than one executions. Ex: main() { int i=0; i++; printf("%d",i);
0
by: Robert | last post by:
In VC++ 6.0 one can move cursore over CString variable and immediately see what is the value of this variable. The small square window shows value in the form strMyString={"String Value"} In the...
28
by: Andre | last post by:
Hi, Does anyone know whether the ECMA, or an other standard document, specifies a maximum for the value that can be pass to the setTimeOut() function in Javascript? Andre
8
by: Pavils Jurjans | last post by:
Hello, I have been developing an Ajax-style framework for couple of years now. Now I am reworking some parts of it. The problem was that I used to use JSON for JavaScript value...
4
by: Java Apache | last post by:
Hi All, I am pretty to new to .NET/C# so go easy! I am developing a Web Service call to a Java Web Service and it is all working fine - it is returning me back a String value which in all...
11
by: Peter Kirk | last post by:
Hi i have a string variable which can take one of a set of many values. Depending on the value I need to take different (but related) actions. So I have a big if/else-if construct - but what is...
3
by: =?Utf-8?B?c3BkMzAwMQ==?= | last post by:
I have a C++/CLI app that uses a logging control in an ATL COM Server. C++ Interop seems to work just fine to pass data from the C++/CLI app to the ATL Control but I can't seem to figure out how...
1
by: Tony Bansten | last post by:
Assume I want to concatenate a literal text value and a variable value for a function parameter then the following does NOT work: objWorkbook.SaveAs("D:\work\v1_" + Filename) The variable...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.