View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mt mt is offline
external usenet poster
 
Posts: 9
Default error 70 - Permission denied

I am attempting some data mining online out of excel. I have managed to log
onto the site and descend down a couple levels of links to the page I want. I
know want to process all the messages on this page. All the messages are
hyperlinks that are numbered and have an
href="/group/pp_dist/message/messagenumber. I am iterating through the links
in a loop and accessing the first such link on the page works fine but the
second one is giving me the error above.

Here is the code. Please, disregard absence of error checking unless it has
a bearing on the solution.

Private Sub connect()
Dim brsr As SHDocVw.InternetExplorer
Dim doc As MSHTML.HTMLDocument
Dim link As HTMLLinkElement
Dim form As HTMLFormElement
Dim username As String
Dim passwd As String
Dim hreference As String
Dim re As VBScript_RegExp_55.RegExp

Set brsr = New SHDocVw.InternetExplorer
brsr.navigate "http://groups.yahoo.com"
'brsr.Visible = True
username = " "
passwd = " "
Set re = New VBScript_RegExp_55.RegExp
re.Pattern = "*/group/pp_dist/messages*/\d+"
re.IgnoreCase = True
re.Global = True

Do While brsr.Busy
Loop

Set doc = brsr.document
If doc.forms.Length 2 Then
With doc
.all("login").Value = username
.all("passwd").Value = passwd
.all(".save").Click
End With
End If

Do While brsr.Busy
Loop

For Each link In doc.links
'MsgBox link.innerText
If link.innerText = "pp_dist" Then
link.Click
Exit For
End If
Next link

Do While brsr.Busy
Loop

For Each link In doc.links
'MsgBox link.innerText
If link.innerText = "Messages" Then
link.Click
Exit For
End If
Next link

Do While brsr.Busy
Loop

For Each form In doc.forms
If form.className = "getmessagenumber" Then
form.all("Message.Number.Input").Value = "1"
form.submit
Exit For
End If
Next form

Do While brsr.Busy
Loop

For Each link In doc.links
hreference = link.getAttribute("href")
If hreference Like "*/group/pp_dist/message/#*" Then
link.Click
Do While brsr.Busy
Loop
MsgBox doc.body.innerText
End If
Next link
brsr.Visible = True
End Sub