none
How To Activate an Embedded Word OLEOBJECT with a Specific Word Application Instance with VBA? RRS feed

  • Question

  • hello,

    i want to activate a Word doc embedded in an Excel sheet in a specific running (or new) instance of Word Application. How?

    On Office 2010

    When i activate the OLEOBJECT with MyOLEObject.Activate, it opens in the running instance of Word. This creates problems with  other open Word docs. 

    i don't want the embedded word doc to interfere with other open Word docs.

    I know i can do:

    Set MyWordApp = CreateObject("Word.Application")

    -- but, how do i activate the OleObject in MyWordApp, instead of a running instance of Word?

    Or, some other way besides CreateObject to activate the OleObject in a new instance of Word?

    thx!


    • Edited by johny w Wednesday, February 24, 2016 5:03 AM
    Wednesday, February 24, 2016 5:02 AM

All replies

  • Hi johny,

    Based on my test, it will select the first instance of word application to open, there isn’t the method or property in OleObject or excel Object model to let it select the other instance of word application.

    How it affect other opened documents?

    You may start a word application first, then to do with word documents in other application. You also may display the word content directly in excel (do not check display as icon), then it can be edited in excel directly.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by johny w Thursday, February 25, 2016 11:17 AM
    • Unmarked as answer by johny w Thursday, February 25, 2016 11:19 AM
    Thursday, February 25, 2016 3:08 AM
    Moderator
  • Re:  word document in excel

    Another viewpoint...
    Create the new Word application and use it to open the Word file directly from the computer drive.
    Just ignore the linked file in Excel.

    '---
    Jim Cone
    Portland, Oregon USA

    • Edited by James Cone Monday, March 28, 2016 3:01 PM
    Thursday, February 25, 2016 3:36 AM
  • it will select the first instance of word application to open

    Ok, that's informative.

    i believe this can be done with the Windows API. Anyone?

    thx. 

    Thursday, February 25, 2016 11:19 AM
  • Create the new Word application and use it to open the Word file directly from the computer drive.
    Just ignore the linked file in Excel.

    It's an embedded file, so there is no file on disk. 

    Thx, tho!

    Thursday, February 25, 2016 11:20 AM
  • Hi johny w,

    >> This creates problems with  other open Word docs.

    How it affects other documents?

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 26, 2016 2:44 AM
    Moderator
  • >> This creates problems with  other open Word docs.

    How it affects other documents?

    We are executing VBA process on the embedded doc. We don't want to disrupt any work in other, unrelated, open Word docs. 

    We're able to manipulate the file in Windows Office by hiding it. Mac Office 2011 does not allow document hiding, so we have to minimize it instead. 

    Awkward, but good enough. 

    thx!

    • Edited by johny w Monday, March 7, 2016 10:46 AM
    Monday, March 7, 2016 10:44 AM
  • Hi johny,

    The excel object model doesn’t provide the better way to deal with it. You may open a thread on Windows Desktop SDK to check whether windows API could do this.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 9, 2016 2:52 AM
    Moderator
  • ok, thx!
    Wednesday, March 9, 2016 11:12 PM
  • Hi,

    You may post the link here after you open a thread on Windows SDK forum.

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 10, 2016 5:30 AM
    Moderator