Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default error 70 - Permission denied

.....
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

I would guess that what is happening is that as soon as you follow the
first link the "doc" object which owns your collection of links
disappears. Try first stuffing all of the links into an array or
collection and then iterating through that (perhaps using .navigate to
get to each URL).

Tim.






"MT" wrote in message
...
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



Reply
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
Run-time error '70': Permission denied Maury Markowitz Excel Programming 0 January 12th 05 08:31 PM
Run time error 70 permission denied Sachin[_4_] Excel Programming 0 August 21st 04 05:07 AM
Permission Denied Error 70 Tom Ogilvy Excel Programming 0 August 3rd 04 04:56 PM
Runtime error Permission Denied Todd Huttenstine[_2_] Excel Programming 1 December 29th 03 10:46 PM
Error Msg: Permission to use object denied A. Nguyen Excel Programming 4 July 14th 03 09:05 PM


All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"