VBA Microsoft Internet Controls Library
The Microsoft Internet Controls Library can be used to programmatically interact with Internet Explorer.
Note: Internet Explorer is no longer supported by Microsoft and may not be available.
Public Sub Example()
Dim IE As Object 'SHDocVw.InternetExplorer
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "https://www.bing.com/"
Do Until IE.readyState = 4 'READYSTATE_COMPLETE
DoEvents
Loop
End Sub
Classes
Class | Description |
---|---|
InternetExplorer | Represents the Internet Explorer browser. |
InternetExplorerMedium | Represents the Internet Explorer browser with Medium Integrity Access Level. May be needed if using Protected Mode in IE8/IE9. Disable Protected Mode could fix issue. There is no ProgID/ClsID for InternetExplorerMedium but could be added to registry. See here and here and here. |
IShellUIHelper | Makes features available from the Windows Shell API. |
IShellUIHelper2 | Extends IShellUIHelper, adding support for custom search providers and scriptable "first run" settings. |
IShellUIHelper3 | Extends IShellUIHelper2, adding support for Windows Internet Explorer 8. |
IShellUIHelper4 | Extends IShellUIHelper3, adding methods that support pinned sites. |
IShellUIHelper5 | Adds special functions for Internet Explorer 10. |
IShellUIHelper6 | Adds special functions for Internet Explorer 11. |
IShellUIHelper7 | |
IShellUIHelper8 | |
ShellNameSpace | |
ShellUIHelper | Makes some shell features available. |
ShellWindows | Represents a collection of the open windows belonging to the Shell. |
WebBrowser | |
WebBrowser_V1 |
Enums and Consts
CommandStateChangeConstants
- CSC_NAVIGATEBACK = 2
- CSC_NAVIGATEFORWARD = 1
- CSC_UPDATECOMMANDS = -1
NewProcessCauseConstants
- ProtectedModeRedirect = 1
OLECMDEXECOPT
- OLECMDEXECOPT_DODEFAULT = 0
- OLECMDEXECOPT_DONTPROMPTUSER = 2
- OLECMDEXECOPT_PROMPTUSER = 1
- OLECMDEXECOPT_SHOWHELP = 3
OLECMDF
- OLECMDF_DEFHIDEONCTXTMENU = 32
- OLECMDF_ENABLED = 2
- OLECMDF_INVISIBLE = 16
- OLECMDF_LATCHED = 4
- OLECMDF_NINCHED = 8
- OLECMDF_SUPPORTED = 1
OLECMDID
- OLECMDID_ACTIVEXINSTALLSCOPE = 66
- OLECMDID_ADDTRAVELENTRY = 60
- OLECMDID_ALLOWUILESSSAVEAS = 46
- OLECMDID_CLEARSELECTION = 18
- OLECMDID_CLOSE = 45
- OLECMDID_COPY = 12
- OLECMDID_CUT = 11
- OLECMDID_DELETE = 33
- OLECMDID_DONTDOWNLOADCSS = 47
- OLECMDID_ENABLE_INTERACTION = 36
- OLECMDID_ENABLE_VISIBILITY = 77
- OLECMDID_EXITFULLSCREEN = 81
- OLECMDID_FIND = 32
- OLECMDID_FOCUSVIEWCONTROLS = 57
- OLECMDID_FOCUSVIEWCONTROLSQUERY = 58
- OLECMDID_GETPRINTTEMPLATE = 52
- OLECMDID_GETUSERSCALABLE = 75
- OLECMDID_GETZOOMRANGE = 20
- OLECMDID_HIDETOOLBARS = 24
- OLECMDID_HTTPEQUIV = 34
- OLECMDID_HTTPEQUIV_DONE = 35
- OLECMDID_LAYOUT_VIEWPORT_WIDTH = 71
- OLECMDID_MEDIA_PLAYBACK = 78
- OLECMDID_NEW = 2
- OLECMDID_ONBEFOREUNLOAD = 83
- OLECMDID_ONTOOLBARACTIVATED = 31
- OLECMDID_ONUNLOAD = 37
- OLECMDID_OPEN = 1
- OLECMDID_OPTICAL_GETZOOMRANGE = 64
- OLECMDID_OPTICAL_ZOOM = 63
- OLECMDID_PAGEACTIONBLOCKED = 55
- OLECMDID_PAGEACTIONUIQUERY = 56
- OLECMDID_PAGEAVAILABLE = 74
- OLECMDID_PAGESETUP = 8
- OLECMDID_PASTE = 13
- OLECMDID_PASTESPECIAL = 14
- OLECMDID_POPSTATEEVENT = 69
- OLECMDID_PREREFRESH = 39
- OLECMDID_PRINT = 6
- OLECMDID_PRINT2 = 49
- OLECMDID_PRINTPREVIEW = 7
- OLECMDID_PRINTPREVIEW2 = 50
- OLECMDID_PROPERTIES = 10
- OLECMDID_PROPERTYBAG2 = 38
- OLECMDID_REDO = 16
- OLECMDID_REFRESH = 22
- OLECMDID_SAVE = 3
- OLECMDID_SAVEAS = 4
- OLECMDID_SAVECOPYAS = 5
- OLECMDID_SCROLLCOMPLETE = 82
- OLECMDID_SELECTALL = 17
- OLECMDID_SET_HOST_FULLSCREENMODE = 80
- OLECMDID_SETDOWNLOADSTATE = 29
- OLECMDID_SETFAVICON = 79
- OLECMDID_SETPRINTTEMPLATE = 51
- OLECMDID_SETPROGRESSMAX = 25
- OLECMDID_SETPROGRESSPOS = 26
- OLECMDID_SETPROGRESSTEXT = 27
- OLECMDID_SETTITLE = 28
- OLECMDID_SHOWFIND = 42
- OLECMDID_SHOWMESSAGE = 41
- OLECMDID_SHOWMESSAGE_BLOCKABLE = 84
- OLECMDID_SHOWPAGEACTIONMENU = 59
- OLECMDID_SHOWPAGESETUP = 43
- OLECMDID_SHOWPRINT = 44
- OLECMDID_SHOWSCRIPTERROR = 40
- OLECMDID_SHOWTASKDLG = 68
- OLECMDID_SHOWTASKDLG_BLOCKABLE = 85
- OLECMDID_SPELL = 9
- OLECMDID_STOP = 23
- OLECMDID_STOPDOWNLOAD = 30
- OLECMDID_UNDO = 15
- OLECMDID_UPDATE_CARET = 76
- OLECMDID_UPDATEBACKFORWARDSTATE = 62
- OLECMDID_UPDATECOMMANDS = 21
- OLECMDID_UPDATEPAGESTATUS = 48
- OLECMDID_UPDATETRAVELENTRY = 61
- OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67
- OLECMDID_USER_OPTICAL_ZOOM = 73
- OLECMDID_VIEWPORT_MODE = 70
- OLECMDID_VISUAL_VIEWPORT_EXCLUDE_BOTTOM = 72
- OLECMDID_WINDOWSTATECHANGED = 65
- OLECMDID_ZOOM = 19