
> set objShellWindows = objShell.Windows 'Here i can able to get IE browser instance when i using iexplore but not the Edge
Edge does not use IE COM interfaces, so this cannot work...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Team,
I'm trying to launch an URL in Edge browser through VBScript without a taskbar and status bar. Please find the snippet below.
URL = "https://www.google.co.in/"
Appli = "msedge about:blank"
dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run Appli, 3
dim objShell
dim objShellWindows
set objShell = CreateObject("Shell.Application")
set objShellWindows = objShell.Windows 'Here i can able to get IE browser instance when i using iexplore but not the Edge
dim objEdge
dim Edge
for each objEdge in objShellWindows
if (not objEdge is nothing) then
if isObject(objEdge.Document) then
set Edge = objEdge.Document
if VarType(Edge) = 8 then
objEdge.ToolBar = 0
objEdge.StatusBar = 0
objEdge.Navigate2 URL
end if
end if
end if
set Edge = nothing
set objEdge = nothing
Next
Could anyone please guide me to get the Ege browser's instance in VBScript?
Note: The same code working fine with IE, if I change msedge as iexplore in Appli variable.
Thanks in Advance,
Vivek Ramesh
> set objShellWindows = objShell.Windows 'Here i can able to get IE browser instance when i using iexplore but not the Edge
Edge does not use IE COM interfaces, so this cannot work...
Edge is just a program. Use the standard VBScript code to start a process and pass the correct arguments.
Dim shell
Set shell = WScript.CreateObject("WScript.Shell")
shell.Run "msedge https://www.google.com --hide-scrollbars --content-shell-hide-toolbar"
Of course if Edge is already open then it'll open a tab in the current window instead. You'll have to play around with the various command line arguments to get the exact behavior you want.