I don't know about the error you get, but I think there's no way to handle InPrivate windows from IE's objects. Here's a workaround that runs IE InPrivate mode and then uses ShellWindows to get the IE object.
Code: Select all
Run, iexplore.exe -private ; Run IE InPrivate mode
; Sleep 1000 ; Wait for IE to finish loading
obj := ComObjCreate("Shell.Application").Windows ; Create a ShellWindows object to get the open windows
for window in obj { ; Look for IE's window
if (window.Name = "Internet Explorer") {
ie := window ; Get the InPrivate window
break
}
}
ie.Navigate("example.com")
I had to use the
Sleep command because
WinWait wasn't working and sometimes ShellWindows coulnd't get the IE window.