I'm using the code below to launch IE and navigate to a website. I'm having a problem with it because the site it goes to uses cookies for user sessions. The cookie contains, among other information, the user's login name. There is also another program that uses the same method to launch IE that goes to the same page, however, it requires a different log in to access different parts of the site. Currently people who launch one program first aren't able to login if they try to launch the second program. If they manually go to the website and do it it works though. Anyone have any ideas as to why this is happening?
Code for first app:
VB Code:
Private Sub Form_Load()
Dim objMSIE1
Dim boolFileExists As Boolean
Dim strNotFound As String
Set objMSIE1 = CreateObject("InternetExplorer.Application")
If Err.Number = 0 Then 'No error
boolFileExists = True
outrc = 0
Else
boolFileExists = False
strNotFound = "I cannot find Internet Explorer." & vbCrLf & "Please download Internet Explorer from www.microsoft.com/windows/ie"
I'm pretty sure this can be solved by launching IE as separate processes, so that each would have it's own process ID. Is there some way to set it up so that they are unique processes?
It looks like the same method to start an IE object, it's just that I need each IE to be a separate process. For example, when you use Internet Explorer and use the right-click 'Open in New Window' command it still lists only one 'IExplore.exe' in the Task Manager processes list. However, if you click the IE icon to start a new Internet Explorer it creates a new 'IExplore.exe' process.
Is there a way to launch IE and specify you want it as a new process?
That's what mine will do as well, the problem is they are all run under the same Process ID. If you launch it to two times it will instantiate two browsers but one process. This becomes a problem when you are working with secure websites.
You can see what I'm talking about if you start Task Manager and go to the processes tab. Launch Internet Explorer to a website with 'TheVader' or my code. You will only see one process of 'IExplore.exe' start up with two instances of the browser windows open (provided you don't have other browsers open besides these two). Now if you launch IE by clicking the icon to start two browsers you will see 'IExplore.exe' listed twice with two unique process ID's.
I guess I could just use Shell instead and see if that brings up two separate processes, which I'm sure it will just a little messier than using objects.
Last edited by bat711; Apr 14th, 2005 at 03:07 PM.
In case anyone else is interested in this problem the only way to resolve it is to call the .EXE directly to create multiple IE processes. Any of the simpler object based ways only create multiple threads and one process.
Below is some code I made for this that finds the location of IExplore.exe through the registry and then launches a website. The registry module is attached.