View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jan Kronsell[_4_] Jan Kronsell[_4_] is offline
external usenet poster
 
Posts: 3
Default Test if spreadsheet id open in IE

Hi

I give a shot, then get back to you.

Jan


"keepITcool" wrote in message
.com...
Jan,

I did a bit of puzzling, but following seems to work
in most cases. (When explorer is open, or when workbook is
open with "open with" Internet Explorer.

the structure of the windows, window parents and captions
is slightly different. However.. there's the IsInPlace property.

You must use the OnTime, as events are run first, before the window is
placed in the IEframe... so you have to build a delay..

Once the user has the window visible the delay is not needed.


'Thisworkbook..
Option Explicit

Dim bDone As Boolean

Private Sub Workbook_Activate()
If Not bDone Then
bDone = True
Call Application.OnTime(Now + TimeSerial(0, 0, 1), _
ThisWorkbook.Name & "!TimedMsg")
End If
End Sub

'Normal non private module
Option Explicit

Sub TimedMsg()
If ThisWorkbook.IsInPlace Then
MsgBox "Yep. I'm loaded in internet Explorer"
endif
End Sub


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Jan Kronsell wrote :

Hi NG!

Is there a way to test if a spreadsheet is opened in native Excel or
in Excel showing in an Internet Explorer window?

Jan