0

have a problem trying to get a URL in VBA, when using automation from "access ie 2003" with IE version 8. The code runs fine util it reaches the statement: artRSSFeed = .Document.Url Bare it in mind the previous URL assignment (FeedURL = .Document.Url) in the same instance of the browser was returned ok and the URL under the second .navigate is reached in the browser. The Error is: Runtime error '445' object doesn't support this action!

Thanks any help appreciated.

   'Process artRSSPostLink in order to get feed name, Source permalink and RSS Feed
     Set ie2 = CreateObject("InternetExplorer.Application")
    With ie2
        ' Disable pop-up msgs
        .Silent = True
        .Navigate artRSSPostlink

        Do While .ReadyState <> 4 Or ie.Busy = True
            DoEvents
        Loop

        If Err Then .Quit Else .Visible = True

        'The point of this is that the Postlink is often not hosted at the feed URL or even on the same server (feeddemon for instance) consequentally it is redirected
        Dim FeedURL As String
        FeedURL = .Document.Url
        artSourcePostPermalink = FeedURL

        'Dim artSource As String
        artSource = Left(FeedURL, InStr(8, FeedURL, "/") - 1)
        artSource = Right(artSource, Len(artSource) - 7) 'strip "http://"
        'Me!artSource = artSource

        'enter the domain/feed url to see if there is a redirect for the feed
        .Navigate "http://" & artSource & "/feed"

        Do While .ReadyState <> 4 Or ie.Busy = True
            DoEvents
        Loop

        artRSSFeed = .Document.Url

    End With
Andrew Seabrook
  • 397
  • 2
  • 17
  • OK looking in a watch I see for some reason document is showing "No Variables". I find I can get what I want from "ie2.LocationURL", however on a different article/source ".document.URL" was available so I would like to understand what the cause is and which I should use to Guarentee the desired results. THanks – Andrew Seabrook Jun 12 '13 at 12:32
  • Hi, Andrew: Can you post the URL you navigate to in the first place? Also, when you exit the final loop, since it has two conditions, which one is letting you out? Use debug.print to check. – Clon Jun 29 '13 at 22:36

1 Answers1

0

Andrew

It works OK to me for the same scenery: Access 2003 & IE8

Well, I run your code, with the exception that I don't declare an "ie" object, so I used ie2 instead for the loop conditions.

I'm assuming that artRSSFeed is declared with the String type.

Sorry for not being more helpful.

Clon
  • 1,035
  • 8
  • 12