LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default deciphering html: listbox

Brian,

If you want to follow up via e-mail then maybe we can sort out your
problem.

saxifrax at pacbell dot net

Tim.


"Brian Delaney" < wrote in message
...
Tim,

Thanks a million. You not only pointed me in the right direction for
nearly (ugh) solving my problem, but, more fortunately for this vba
beginner, your procedure and functions REALLY helped me to get a
better
grasp on the HTML object model, the syntaxes for which I'd been
struggling to interpret from MSDN libraries.

I needed to take your procedure one step further than selecting the
option. I also needed to activate it because, unlike the Xe site,
the
site I'm working on doesn't have the eqivalent of a 'Submit' button;
rather, just selecting the option causes the navigation to the next
page. I cannabalized your SetList function to accomplish this

Dim o As Object, el As Object, y As String

'get a reference to the document object
Set o =
GetHTMLDocument("http://www.futons.net/index.asp?PageAction=VIEWPROD&Pro
dID=2845")

Set el = o.frmMFGSearch.txtSearch 'list has no "id" attribute
'Set el = o.getElementById("FilterNameSelect") 'list has an "id"
y = "Dream On Futon Covers"

If Not o Is Nothing Then
Dim x As Integer
For x = 0 To el.Options.Length - 1
If el.Options(x).Text = y Then
el.selectedIndex = x
el.fireEvent ("onchange")
Exit For
End If
Next
End If

End Sub

Unfortunately, I still can't get this to work on my target web page
because I can't identify a form to which the listbox object belongs.
(I
may be dealing with frames?) The page is organized by multiple Tabs,
on
only one of which the listbox appears. I tried substituting the
particular Tab id (as well as a few others) for the form name but no
luck. AND there is also relevant HTML code for a form which does
contain
the selected option but

Set el = o.FormName.ListboxName

returns Error 438.

I'm baffled. (And, sorry, I'm reluctant to post the HTML code
because
it's for a web page on a brokerage site and I'm new enough to this
to
still not know what type of info is safe to post to newsgroups.)

Thanks for your help so far and any more you can offer.

Brian

P.S. The Xe site was a relevant and coincidental reference as I had
just
the day before been trying to download info from one of its
tables...and
gave up! That said, any tips on just copying a table from a web page
in
its HTML format into an excel sheet?

*** Sent via Developersdex http://www.developersdex.com ***



 
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
Stop excel from processing HTML? IE paste raw html. nick Excel Discussion (Misc queries) 2 April 21st 23 05:12 PM
Newbie needs help deciphering formula. Grimzby Excel Worksheet Functions 2 January 17th 06 03:46 AM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
Help Deciphering a Lotus Macro Snippet Raul[_4_] Excel Programming 2 April 21st 04 01:03 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 11:25 AM.

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"