LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Workbook container - can't get it to work

I cannot get this to work - is there a reference I am missing or ???

Sub TestContainer()
msgbox thisworkbook.container
end sub

I've gleened this from

Sub CheckIfInInternetExplorer()
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
End Sub


which I can't get to work either. It compiles, but activeworkbook.container
yields an error.

Ive tried three different machines, and have tried Excel 97, 2000 & 2003.

I am trying to determine if the excel workbook has been opened in a browser,
or the excel application.

Thanks in advance,

 
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
Using Container in Auto open macro [email protected] Excel Discussion (Misc queries) 0 November 9th 06 11:22 AM
Container property Stewart Walker Excel Programming 0 May 28th 04 10:28 AM
Excel macro for delete a clipboard container Aldo Morandi Excel Programming 1 January 15th 04 01:49 PM
OLE Container Control in VB.NET Yi[_2_] Excel Programming 5 October 14th 03 02:41 AM
Iterate over Collection Objects in Container. Bob Kilmer Excel Programming 1 August 28th 03 02:37 AM


All times are GMT +1. The time now is 06:23 AM.

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"