Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Tell if workbook is opened in IE

Hey Guys,

I was wondering if there is a way I can tell if a workbook that has been
opened is hosted in Interner Explorer.

Ideally what I would like to do is checked if the workbook/ excel
application is hosted in IE on one of the Applciation start up events and
then disable some off my code accordingly.

Thanks for you help.

Regards........Jim




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tell if workbook is opened in IE

I was wondering if there is a way I can tell if a workbook that has
been opened is hosted in Interner Explorer.

I'd love to know this as well.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Tell if workbook is opened in IE

In another forum, Jim Rech suggested using ActiveWorkbook.Container.

Ture Magnusson posted this using Jim's suggestion:

Thanks Jim!

Container works perfectly...

Sub CheckIfInInternetExplorer()
'Declare local variable
Dim x As Object

'Try to get container object
On Error Resume Next
Set x = ActiveWorkbook.Container
On Error GoTo 0

'Show result depending on container's typename
Select Case TypeName(x)
Case "Nothing"
MsgBox "The workbook is opened in Excel"
Case "IWebBrowser2"
MsgBox "The workbook is opened in Internet Explorer"
Case Else
MsgBox "The workbook is opened in another application: " & TypeName(x)
End Select

'Clear object variable
Set x = Nothing
End Sub

/Ture


jnc wrote:

Hey Guys,

I was wondering if there is a way I can tell if a workbook that has been
opened is hosted in Interner Explorer.

Ideally what I would like to do is checked if the workbook/ excel
application is hosted in IE on one of the Applciation start up events and
then disable some off my code accordingly.

Thanks for you help.

Regards........Jim


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a workbook if not opened, going to it if already opened neotokyo[_3_] Excel Programming 0 September 24th 04 08:56 PM
Opening a workbook if not opened, going to it if already opened neotokyo[_2_] Excel Programming 1 September 24th 04 07:17 PM
Opening a workbook if not opened, going to it if already opened neotokyo Excel Programming 1 September 24th 04 06:33 PM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM
Sheets select method fails when workbook is opened by another workbook Mike Excel Programming 2 June 8th 04 04:17 AM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"