vbscript-create-an-internet-explorer-instance-and-navigate-to-a-webpage

VBScript - Create An Internet Explorer Instance And Navigate To A Webpage

This script file allows you to create an MS Internet Explorer instance and then navigate to a webpage.

VBScript

  • 5523
  • 1942
  • 1
  • 0
Add to collection
© 2024VBAmacros.net

1 Open your favorite text editor. In our case we are going to use Notepad++

2 Copy the VBScript code from below.

3 Paste the code in the newly created file.


4 Save the file with a ".vbs" extension.


5 Run the script file by double-clicking on it or via the CMD console.


6 That's it!


Advertisement

Code
' This script creates an MS Internet Explorer instance and navigates to a webpage.
Sub createAnInternetExplorerInstance()
	' Set variables
	Dim appInternetExplorer
	Dim strLinkToWebpage
	' Create new internet explorer application object
	Set appInternetExplorer = Wscript.CreateObject("InternetExplorer.Application")
	' Set webpage link
	strLinkToWebpage = "https://www.msn.com/"
    	' Use the newly created internet explorer instance
   	 With appInternetExplorer
        	' Set window width
        	.Width = 1000
		' Set window height
		.Height = 500
		' Set window top position
		.Top = 0
		' Set window left position
		.Left = 0
		' Set visibility state
		.Visible = True
		' Navigate to webpage
		.Navigate strLinkToWebpage
    	End With
	' Release the internet explorer application object
	Set appInternetExplorer = Nothing
End Sub
' Run the procedure
Call createAnInternetExplorerInstance()
Advertisement


Comments
Sort by:
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Advertisement
  • Created
    19-May-2020
  • Last updated
    13-Jun-2020
Advertisement
VBAmacros.net VBAmacros.net
Code was successfully copied!
VBAmacros.net VBAmacros.net
Please sign in!
VBAmacros.net VBAmacros.net
You've already voted!