none
Fresh install of Office 2013 - Excel Window shows during interop even though it was activated with wdOLEVerbHide RRS feed

  • Question

  • I have the strangest issues with Office 2013.  Here's the setup.

    1.  Clean install of Windows 7 SP1
    2.  Install Office 2013, the only version of Office on this machine.
    3.  Run Word.exe and Excel.exe to let it do its initialization thing
    4.  Run our Interop code, which operates on a Word doc (2003) with embedded Excel charts.  When the code runs, I see Excel windows opening up and going away as it operates on the charts.

    The strange thing is, after a few times doing this, the Excel windows stop showing up.  Almost always.  We had one machine that the Excel windows didn't stop showing up.  On this machine, I was able to get the Windows to not show up by running both the Word and Excel executables with the /regserver switch.

    For each of the graphs being operated on, we are activating the object with the "wdOLEVerbHide" parameter:

    m_Document.InlineShapes.Item(i).OLEFormat.DoVerb(Word.WdOLEVerb.wdOLEVerbHide)

    We tried running Word.exe and Excel.exe with the /regserver switch before our first run of our interop code and the Excel windows still showed up.  

    This is not acceptable for our product, and this does not happen for any of the previous versions of Office, just 2013.  Anyone have any idea why it is not honoring the "Hide" flag, and why sometimes it corrects itself?  

    Thanks,
    Terry

    Wednesday, May 21, 2014 6:36 PM

All replies

  • Hi Terry,

    Based on the description, the Excel application shows up after op execute the code to hide it. And this issue only occurs on a specific machine. Am I right?

    As far as I know, the /regserver switch is used to forces Excel to register itself and then quit. Use this switch when you want Excel to rewrite all its registry keys and reassociate itself with Excel files, such as workbooks, charts, and others.( refer to Description of the startup switches for Excel)

    Have you installed any add-ins for Excel? If yes, I suggest you disabling all add-ins to see whether this issue was caused by custom add-ins.

    If this is not helpful, would you mind sharing the specific Word document and a code sample with us to reproduce this issue? You can remove the sensitive information and upload it to OneDrive.

    Best regards

    Fei


    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, May 22, 2014 8:06 AM
    Moderator
  • Hi Terry

    What kinds of graphs (charts) are these? Since the introduction of the new charting engine in Office 2007 OLE is not used for graphing - that's why I ask. Are these Excel 97-2003 graphs?

    Is it possible that the graphs have been converted to the new charting engine? Word might do that - without asking. And there is no way to suppress Excel appearing if that's the case.

    The "correct" way to work with charts, if you don't want Excel showing up, is to work directly with the Open XML file format and not with automation.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, May 22, 2014 2:03 PM
    Moderator
  • Yes, these are Excel 2003 graphs.  There are several machines that show this behavior.  On all but one of them, the problem goes away after a few tries.  

    So, is it fair to say that the "correct" way would mean ditching Office 2003 support and recreating all the charts with at least Office 2007?

    Terry

    Tuesday, May 27, 2014 8:46 PM
  • Hi Terry

    Well, the problem you're seeing is - I THINK - due to the fact that the UI is designed to work differently with the new charting engine. By design, the new charting engine will display the Excel window.

    IF Word is converting the charts to the new engine, then they're are no longer "OLE", so DoVerb won't have the expected effect. Since you're apparently not getting any error message I'm not sure the charts are getting converted, but Word would appear to be having difficulty "understanding" what they are.

    "So, is it fair to say that the "correct" way would mean ditching Office 2003 support and recreating all the charts with at least Office 2007?"

    "Recommended" would be that you use the new charting engine for documents in the new file format. And that, unless you need to interact with the user, you work on the closed files, via the Office Open XML file format (OpenXMLDeveloper.org to get an idea what this is and how to get started).

    I have no idea why the old code would sometimes work one way and other times another. Nor why re-registering the Office apps could have this kind of effect. If I really wanted to know I'd probably try comparing Registry entries to see if I could find what changes. But there are a LOT of Registry entries and I don't know which ones the regserver switch resets to installation default. People in the IT Pro forums on the TechNet site might have an idea about that.

    The only other thing that occurs to me, that could be mixing in is the fact that Word 2013 has a new layout engine. Possibly, something with that is triggering the display of the Excel window...


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, May 29, 2014 9:38 AM
    Moderator
  • Thanks, Cindy.  You've been very helpful and knowledgeable.  

    Is there a web site or MSDN page that I could reference to read more about the changes made in the various versions of Office?  For example, new charting engine in 2007, new layout engine in 2013.  I'd like to put together a document for our team that summarizes this information, along with my own findings.  

    Terry

    Thursday, May 29, 2014 6:43 PM
  • Hi Terry

    I'm not aware of any site (my information comes from other sources), but your best bet would probably be/have been the blogs written by the various "teams" (Word, Office, etc.)

    I just went looking for them and find that things have been changed and most of the informative, old material simply isn't there anymore. Nor a listing of links to past blog posts, such as we're accustomed to from "normal" blog sites. It appears no one wants you to know about or use the Office apps as we have known them before the release of "Web apps"...

    http://blogs.office.com/product/word/


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, May 30, 2014 6:27 PM
    Moderator