Solved

WebBrowser Document Help

Posted on 2008-06-12
7
624 Views
Last Modified: 2008-08-02
If I say:
wb.document.all("somevaluehere").value = "asdf"

then the textbox called "somevaluehere" gets the value "asdf" written to it.

Why doesn't this work?


Private Sub Whatever()

'the below variable is getting a list of values

'from an HTML page

Dim varSomething() as string
 

wb.document.all(varSomething(0)).value = "asdf"

End Sub

Open in new window

0
Comment
Question by:Takamine334
  • 3
  • 2
7 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 500 total points
ID: 21780994

Private Sub Whatever()

'the below variable is getting a list of values

'from an HTML page

Dim varSomething() as string
 

redim  varSomething(0)

varSomething(0) = "somevaluehere"

wb.document.all(varSomething(0)).value = "asdf"

End Sub

Open in new window

0
 

Author Comment

by:Takamine334
ID: 21783393
So, I have to reDim all the variables? 1,2.3,4, etc?
0
 

Author Comment

by:Takamine334
ID: 21786803
?
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 21787123
yes ie

ReDim Preserve varSomething(0)
ReDim Preserve varSomething(1)
ReDim Preserve varSomething(2)

or if you know how many variable to store i.e. 10

you can
ReDim Preserve varSomething(9)   '0-9
0
 

Author Comment

by:Takamine334
ID: 21789298
It's much better to use this method:
Public wbDoc As HTMLDocument
Set wbDoc = wb.Document

wbDoc.all(varSomething(x)).value = "asdf"
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now