Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How does one tell if Worksheet embedded (Excel 2000)

    Is there way to tell if an Excel workbook or Worksheet is actually an embedded Worksheet inside a Word doc?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one tell if Worksheet embedded (Excel 2000)

    Like this:

    If InStr(Application.CommandBars.FindControl(ID:=106) .Caption, "&&") _
    > 0 Then
    ' In embedded mode
    elseIf ActiveWorkbook.IsInplace Then
    ' Editing in place
    End If
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one tell if Worksheet embedded (Excel 2000)

    One solution I found for telling if an Excel Worksheet is an embedded worksheet in Word is to check to see if the Application.Visible of Excel is visible. If it is False then it is an embedded Worksheet and if True then it is a regular visible Workbook instance.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How does one tell if Worksheet embedded (Excel 2000)

    And what if somebody starts an instance of Excel by automation from another application? The instance will be invisible by default.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one tell if Worksheet embedded (Excel 2000)

    For the problem we are encountering in our COM addin we don't want to use methods in our COM addin if the Workbook instance is invisible so that should be OK but may not be the all around solution.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one tell if Worksheet embedded (Excel 2000)

    If there is an Excel session already open, its window will be visible AND used by the embedded Excel object. I had the same problem with my Autosafe addin and solved it using the method I gave.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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