Be the first user to complete this post

  • 0
Add to List

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

To Maximize, Minimize and Restore Internet Explorer (IE) using Microsoft Excel, follow the steps mentioned below

Steps:Create the object of Internet Explorer

  • Make the Internet Explorer visible
  • Navigate to the specified URL
  • Wait till the browser is busy and page is fully loaded
  • Create WshShell (Windows Script Host) object
  • Use send keys function to maximize, minimize and restore operations


Create the object of Internet Explorer

        Set objIEBrowser = CreateObject("InternetExplorer.Application")

Make the Internet Explorer visible

        objIEBrowser.Visible = True

Navigate to the specified URL

        objIEBrowser.Navigate2 "www.google.com"

Wait till the browser is busy and page is fully loaded

        Do While objIEBrowser.Busy

Loop

Create WshShell (Windows Script Host) object

        Set oShell = CreateObject("WScript.Shell")

Use send keys function to maximize, minimize and restore operations

                oShell.SendKeys "% x" ‘ MAXIMIZE

                oShell.SendKeys "% n" ‘ MINIMIZE

                oShell.SendKeys "% r" ‘RESTORE

Complete 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



Also Read:

  1. VBA-Excel: Add Table and fill data to the Word document
  2. VBA-Excel: Working with Bookmarks- Insert text After Bookmark
  3. VBA-Excel — AttachmentFetcher — Download all the Attachments from All the Mails of Specific Subject in Microsoft Outlook .
  4. VBA-Excel: Add/Insert multiple Images/Pictures from a folder in Word Document
  5. VBA-Excel: Get the Instance of already opened word document