View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GTVT06 GTVT06 is offline
external usenet poster
 
Posts: 141
Default How to detect if workbook is running in Internet Explorer

On Mar 24, 2:29*pm, Greg Lovern wrote:
If IsRunningInIE Then
* * MsgBox "Explanatory message, etc."
Exit Sub


Sorry, I meant:

If IsRunningInIE Then
* * MsgBox "Explanatory message, etc."
* * Exit Sub
End If

Greg


you can close it by looping thru open windows and closing down the
window if the URL = whatever shows up in the internet explorer URL
address bar whenever they open it in IE

Dim objShell, ObjShellWindows, objW
Set objShell = CreateObject("Shell.Application")
Set ObjShellWindows = objShell.Windows
For Each objW In ObjShellWindows
If objW.LocationURL Like "whatever shows up" Then
objW.Quit
End If
Next
Exit Sub