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" MsgBox strNotFound, vbCritical, "Application Error" outrc = 1 Exit Sub End If objMSIE1.Navigate ("https://website/") objMSIE1.Visible = True Set objMSIE1 = Nothing Unload Me End End Sub
Code for second app:
VB Code:
Private Sub Form_Load() Dim objMSIE Dim boolFileExists As Boolean Dim strNotFound As String Set objMSIE = 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" MsgBox strNotFound, vbCritical, "Application Error" outrc = 1 Exit Sub End If objMSIE.Navigate ("https://website/") objMSIE.Visible = True Set objMSIE = Nothing Unload Me End End Sub




Reply With Quote