none
My add-in is disabled if I run a second instance of Word RRS feed

  • Question

  • I have a word add-in ( created by anothe person in house) and if I start Word, the add-in is there in the toolbar and fully enabled.  If I start a second instance of Word, the add-in is there but is disabled in this new instance.  Is this standard behavior or is there something I can do in the add-in to make it work for multiple instances of Word running at the same time?   This is Word 2010.

    KathyL

    Friday, June 6, 2014 1:18 PM

Answers

  • Hello Kathy,

    No, that is definitely not a standard behavior. Most probably your add-in fired an exception and Word disabled it.

    The How to: Re-enable an Add-in That Has Been Disabled article in MSDN states the following:

    Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.

    Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.

    Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.  

    When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again.

    I'd recommend debugging the code and find the cause.

        

    Friday, June 6, 2014 1:29 PM
  • Hi Kathy

    <<in ( created by anothe person in house)>>

    I recommend you contact the person who created the add-in and discuss the problem with him/her.

    Can you be sure you've started a new INSTANCE of Word? Or could it be a new document running in the same instance? Word will always open documents in separate windows, but you're usually dealing with the same application instance. That does make a difference when trying to trouble-shoot a problem.

    It's possible the add-in wasn't designed to run with multiple document or multiple application instances. But only the person who created the add-in will be able to track down what the problem is and, possibly, fix it.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 6, 2014 3:43 PM
    Moderator

All replies

  • Hello Kathy,

    No, that is definitely not a standard behavior. Most probably your add-in fired an exception and Word disabled it.

    The How to: Re-enable an Add-in That Has Been Disabled article in MSDN states the following:

    Microsoft Office applications can disable add-ins that behave unexpectedly. If an application does not load your add-in, the application might have hard disabled or soft disabled your add-in.

    Hard disabling can occur when an add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your add-in is executing.

    Soft disabling can occur when an add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable an add-in if it throws an unhandled exception while the Startup event handler is executing.  

    When you re-enable a soft-disabled add-in, the application immediately attempts to load the add-in. If the problem that initially caused the application to soft disable the add-in has not been fixed, the application will soft disable the add-in again.

    I'd recommend debugging the code and find the cause.

        

    Friday, June 6, 2014 1:29 PM
  • Hi Kathy

    <<in ( created by anothe person in house)>>

    I recommend you contact the person who created the add-in and discuss the problem with him/her.

    Can you be sure you've started a new INSTANCE of Word? Or could it be a new document running in the same instance? Word will always open documents in separate windows, but you're usually dealing with the same application instance. That does make a difference when trying to trouble-shoot a problem.

    It's possible the add-in wasn't designed to run with multiple document or multiple application instances. But only the person who created the add-in will be able to track down what the problem is and, possibly, fix it.


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 6, 2014 3:43 PM
    Moderator
  • No, it is definitely a second instance of word because the document title in the first instance says Document1 and the second instance it says Document2.  I'm not sure how I can tell if the add-in was designed to not work with multiple documents.

    KathyL

    Friday, June 6, 2014 3:47 PM
  • Hi Kathy

    The incrementation of the document "counter" is no indication of whether a document window is in the same or a different instance of the Word application. As long as any instance of Word is running, this number will increment.

    View/Windows could give an indication: if the documents are all listed, then they're all running in the SAME instance.

    <<in was designed to not work with multiple documents.>>

    You cannot, only the person who created the add-in can (or someone who can look at the original code and understand it).


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, June 6, 2014 4:07 PM
    Moderator
  • In task manager, on the Application tab it shows Document1 - Word and Document2 - Word.  On the Process tab, it has just one instance of Winword.exe.  So I guess it didn't launch 2 separate instances of Word.


    KathyL

    Friday, June 6, 2014 4:26 PM