0

I'm trying to open Internet Explorer for a specific IE only site.

Depending on the amount of quotes I get

invalid argument

or

file not found

Disclaimer:
Ignore any out of place spaces and capital letters. I can't copy paste my code since my PC has no internet connection and is inside a virtual machine at work. I'm typing this on my phone.

On cmd

%program files%\internet explorer/iexplore.exe -private myurl

works fine

On Excel, Shell commands throws a error file not found

URL = "%program files%\internet explorer/iexplore.exe -private myurl" 
Shell """" & URL & """"
Community
  • 1
  • 1
Aeon
  • 87
  • 10

2 Answers2

0

Try:

Shell Environ("ProgramFiles") & _
      "\internet explorer\iexplore.exe -private http://www.google.com"
Tim Williams
  • 154,628
  • 8
  • 97
  • 125
-1

Okay so I found the correct way to open internet explorer in vba here it is

Sub openie ()

Dim iebrowser as object

set iebrowser = createobject("InternetExplorer.Application")

iebrowser.visible =true iebrowser.Navigate2 "www.google.pt"

End sub

Aeon
  • 87
  • 10