Results 1 to 3 of 3
  1. #1
    mcpearce is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Location
    Perth
    Posts
    20

    Get URL (or part thereof) from Internet Explorer Application

    Hi Ladies and Gents,

    I've put together some code to pull/push data from MYOB (a commonly used accounting program here in Australia) via APIs. It all works beautifully with the locally stored company file, but i'm having some issues getting at the data stored in the cloud version.

    The following part of my code works...

    Code:
    Set oIExplorer = New InternetExplorer
    
    
    With oIExplorer
        .Navigate CreateAuthRequest()
        .Visible = True
    End With
    
    This results in the URL being updated to: http://[my redirect URI]?code=XXXXXXXXXXXXXXXXXXXXXXXXX

    I've had a crack at:

    1. Using oIExplorer.LocationURL to get the whole string (which gives me the boolean response True); and
    2. oIExplorer.Document.getElementbyid("code").Value to get just the code value (which gives me an "Object Required" error).

    Not sure where to go with this next. Any help much appreciated.



    Mitch

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    get the address off the webbrowser:

    sUrl = oIExplorer.LocationURL

  3. #3
    mcpearce is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Location
    Perth
    Posts
    20
    Thanks ranman256,

    I had tried oIExplorer.LocationURL, but it appears I needed to add the following code before access would get the URL

    Code:
    While oIExplorer.Busy Or oIExplorer.ReadyState <> READYSTATE_COMPLETE: DoEvents: Wend
    Problem solved

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trying to control Internet Explorer in VBA
    By Glenn_Suggs in forum Modules
    Replies: 21
    Last Post: 09-25-2014, 08:44 AM
  2. VBA > Internet Explorer
    By Stokecpa in forum Programming
    Replies: 3
    Last Post: 08-06-2012, 01:10 AM
  3. Internet Explorer automation with VBA
    By sa230e in forum Programming
    Replies: 0
    Last Post: 09-29-2011, 05:04 PM
  4. Search any field and part thereof
    By Johan in forum Programming
    Replies: 0
    Last Post: 09-08-2008, 02:18 AM
  5. Search any field and part thereof
    By Johan in forum Forms
    Replies: 0
    Last Post: 09-03-2008, 08:01 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums