nbraybrook
New Member
- Joined
- Aug 3, 2011
- Messages
- 7
Hi experts!
Here is what I am trying to do. I have a button on my excel sheet to take the user to the time sheet system which is html based. They click the button it will take them to the time sheet interface in IE. But alot of users leave the time sheet window open in IE. So what I want my macro to do is if that page is already open then just bring that ie window to the front, if its not then open ie and take you to that page. I am currently trying the code below problem is even time I click the button it is opening a new tab of the same page in IE if IE is already open. I just want it to not open a new tab if IE is already open
Here is what I am trying to do. I have a button on my excel sheet to take the user to the time sheet system which is html based. They click the button it will take them to the time sheet interface in IE. But alot of users leave the time sheet window open in IE. So what I want my macro to do is if that page is already open then just bring that ie window to the front, if its not then open ie and take you to that page. I am currently trying the code below problem is even time I click the button it is opening a new tab of the same page in IE if IE is already open. I just want it to not open a new tab if IE is already open
Code:
Sub GetIE_LateBinding()
Dim IE As Object
With CreateObject("Shell.Application").Windows
If .count > 0 Then
' Get IE
Set IE = .Item(0) ' or .Item(.Count - 1)
Else
' Create IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
End If
IE.Navigate "http://timesheetaddyhere/"
Set IE = Nothing
End With
End Sub
[FONT=Courier New][COLOR=darkblue]
[/COLOR][/FONT]
Last edited: