The VBA code you show won't open Edge browser. I guess it opens Edge because this policy is set on your computer so the site is redirected to Edge. Besides, Edge doesn't have an API that VBA can use, and even more unlikely that you use an IE function ie.Quit
to close Edge browser.
As a workaround, you can try to call shell command in VBA to kill Edge process: Call Shell("TaskKill /F /IM msedge.exe")
. I made a code example like below, it can close Edge browser successfully. You can also refer to it:
Sub LOADEdge()
Set obj = CreateObject("Shell.Application")
obj.ShellExecute "microsoft-edge:http://player.streamguys.com/gpb/sgplayer"
Application.Wait (Now + TimeValue("00:00:10"))
Call Shell("TaskKill /F /IM msedge.exe")
End Sub
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Regards,
Yu Zhou