View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams Tim Williams is offline
external usenet poster
 
Posts: 1,588
Default HTML Document.Links Issues

Gergg,

Hard to tell exactly what the problem is without seeing any code.
Are you automating IE to do your work ?

Tim


"Gregg Roberts" wrote in message
...
Thanks to dicks-blog.com I've just recently managed to find out how to
access
web pages and bring the data back to Excel (2000) VBA even when it's not
in a
table. The possibilities are very exciting. But I have run into two vexing
problems.

1) The same code that retrieves the collection of links on a page --
essentially, Document.Links -- works with two homepages and fails on a
third.
The links on the third look the same to me -- static links with plain text
anchors.

2) One of my tasks is to list out the links in a sort of tree structure.
It
would make sense to do this recursively, up to a user-specified number of
levels deep. But I started with a non-recursive model, figuring it would
be
easier to debug. Moving to the second level, I load the page that the
first
link points to, and grab ITS link collection, storing that in a different
variable. I process the page and come back to the first level. At that
point,
trying to access the links collection so I can process the next link gives
me
an Error 70, Permission Denied. This happens even if I reload the
first-level
page and then try to re-retrieve the collection.

Since I've already stored the links collection in a variable, it shouldn't
matter that I've left the page where I got it from, should it? And why
can't
I re-retrieve it even if I reload the page? Reloading is an abuse of
bandwidth and would make the macro take much longer to run, so I really
want
to preserve the loaded links collection and just keep referring to it.

TIA,
Gregg Roberts