Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

VBA-Excel: Maximize, Minimize and Restore Internet Explorer (IE) using Microsoft Excel.

To Max­i­mize, Min­i­mize and Restore Inter­net Explorer (IE) using Microsoft Excel, fol­low the steps men­tioned below

Steps:Create the object of Inter­net Explorer

  • Make the Inter­net Explorer visible
  • Nav­i­gate to the spec­i­fied URL
  • Wait till the browser is busy and page is fully loaded
  • Cre­ate WshShell (Win­dows Script Host) object
  • Use send keys func­tion to max­i­mize, min­i­mize and restore oper­a­tions


Cre­ate the object of Inter­net Explorer

        Set objIEBrowser = CreateObject(“InternetExplorer.Application”)

Make the Inter­net Explorer visible

        objIEBrowser.Visible = True

Nav­i­gate to the spec­i­fied URL

        objIEBrowser.Navigate2 “www.google.com”

Wait till the browser is busy and page is fully loaded

        Do While objIEBrowser.Busy

Loop

Cre­ate WshShell (Win­dows Script Host) object

        Set oShell = CreateObject(“WScript.Shell”)

Use send keys func­tion to max­i­mize, min­i­mize and restore operations

                oShell.SendKeys “% x” ‘ MAXIMIZE

                oShell.SendKeys “% n” ‘ MINIMIZE

                oShell.SendKeys “% r” ‘RESTORE

 

Com­plete Code:

Function FnMaxMinRestoreIE()

    Dim objIEBrowser

    Set objIEBrowser = CreateObject("InternetExplorer.Application")

    objIEBrowser.Visible = True

    objIEBrowser.Navigate2 "www.google.com"

  Do While objIEBrowser.Busy

  Loop

    Set oShell = CreateObject("WScript.Shell")

    oShell.SendKeys "% x" ‘ Maximize

    oShell.SendKeys "% n" ‘Minimize

    oShell.SendKeys "% r" ‘ Restore

End Function

 

 

You may also like...

3 Responses

  1. henrique says:

    Hi.
    How can i acti­vate an already loaded (opened) Inter­net Explorer?

    For exam­ple:
    i have already the google.com opened in a win­dow.
    and i wanna a Macro to send a data to the search bar at this already opened win­dow (google.com).

    Tnks

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: