Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8147065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:13:14+00:00 2026-06-06T14:13:14+00:00

I am working with the Internet Explorer object in Visual Basic. Is there a

  • 0

I am working with the Internet Explorer object in Visual Basic. Is there a way to copy the current URL IE is displaying so I can paste it elsewhere with my clipboard?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:13:15+00:00Added an answer on June 6, 2026 at 2:13 pm

    Assuming you already have the IE window identified, which itself is a little more complicated – I can elaborate on this if needed:

    Dim ieIEWindow As SHDocVw.InternetExplorer
    Dim sIEURL As String
    
    'Set your IE Window
    
    sIEURL = ieIEWindow.LocationURL
    

    To get the IE window, you’ll need to reference the Microsoft Internet Controls library (ieframe.dll) in the VBA editor by going to Tools=>References... and selecting it from the list. If that item is not available, the .dll file for me is located at C:\Windows\System32\ieframe.dll.

    Once the reference is set, you’ll have access to the so-called SHDocVw library in your code.

    You can grab the IE window (assuming only one open) using the following (untested, modified/reduced from my own working code):

    Public Function GrabIEWindow() As SHDocView.InternetExplorer
    
    Dim swShellWindows As New SHDocVw.ShellWindows
    Dim ieOpenIEWindow As SHDocVw.InternetExplorer
    
        Set GrabIEWindow = Nothing
    
        ' Look at the URLs of any active Explorer windows 
        ' (this includes WINDOWS windows, not just IE)
        For Each ieOpenIEWindow In objShellWindows
    
            ' Check the I.E. window to see if it's pointed 
            ' to a web location (http)
            If Left$(ieOpenIEWindow.LocationURL, 4) = "http" Then
                ' If so, set this window as the one to use. 
                ' This will need to be modified to create
                ' a list if you want to select from more
                ' than one open window
    
                ' Optional grab the HWND for later reference...
                Dim lWindowID As Long
                lWindowID = ieOpenIEWindow.HWND
    
                Set GrabIEWindow = ieOpenIEWindow
    
                Exit Function
            End If
    
        Next OpenIEWindow 
    
    End Function
    

    The above can also be modified to allow for a selection of multiple open IE windows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A project I am working on is using pushState, but since Internet Explorer can't
this is my code for player its not working in internet explorer. can anyone
Recently an application I wrote started not working on Internet Explorer. There has been
document.getElementById(...).setAttribute('style',... is not working in Internet Explorer 7.0. How can I make this work
Im trying to get a form working in Internet Explorer. I see that when
Hi i am working on an internet explorer automation and this is new territory
Right now I'm working on a Internet Explorer add on which is supposed to
I struggle with working with Internet Explorer. Issue one: I have used min-height:100% and
A HTML5 video I am implementing is not working in Internet Explorer 9. After
I've a managed Explorer Bar (working in Internet Explorer) that is working reasonably well.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.