Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Ascertain if an instance of Excel is opened in IE (Windows 2K Office 2K I

    Is it possible to write some code to ascertain whether an excel workbook has been opened embedded in IE (as described in <post#=304432>post 304432</post#> or in a separate session of excel. I have a workbook that users open via a link on our intranet. I have some code to, amongst other things, maximise the window and set full screen view. This is fine if it opens in a separate excel session but if it opens embedded in IE, an error occurs regarding full screen. As I am unable to ensure that all users will have their settings set so as to open excel in a separate session, I thought that if I could ascertain in what state the workbook had been opened, I could use an If scenario.

    Thanks in advance

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Ascertain if an instance of Excel is opened in

    I have a vague memory that this came up once before, and we were trying to see if the window title would give away the location (if the title includes Internet Explorer, that would be the giveaway). If you do some searching on this board, that thread might pop up -- or not!

  3. #3
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ascertain if an instance of Excel is opened in

    Hi Raymond,

    I don't do much Excel programming, but a few minutes of tinkering identified one possibility you may want to investigate.

    Whenever I opened an Excel spreadsheet via Internet Explorer, I got an error when trying to read ActiveWindow.Parent.Name. When I opened the same file in Excel directly, there was no error.

    Perhaps a test trying to assign ActiveWindow.Parent might work.

    Hope this helps in some way.

    Cheers!

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ascertain if an instance of Excel is opened in

    Is it sufficient to check App;ication.UserControl?

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Ascertain if an instance of Excel is opened in

    Workbooks have a Container property which should help.

    See the thread Detect Excel running in browser

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •