Workbook container - can't get it to work
I cannot get this to work - is there a reference I am missing or ???
I've gleened this from
> 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,
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Search Engine Friendly URLs by vBSEO 3.6.0 RC 1