none
Using Activex in VSTO in Windows 7 64 bits RRS feed

  • Question

  •  Hello    ,

    I am facing this problem    .

    I have created a vsto applicatio for Microsoft word. This application is using an existing third party activex. The  document was opened and works without any problem in Windows XP  .

     It does not work in Windows 7 Professional 64 bits.

    This is the problem.

    If I open the MS-Word document as Administrator I receive this error message: There was a problem sending the command to the program. But if I open the document from the File/Open of MS-Word the document is opened and the vsto is working well (Including the getobject of the activex)

     If I open Microsoft word document not as administrator so the document is opened but this programming command:

     

    oEAApp = CType(GetObject), EA_APPLICATION), EA.App) 

    caused this error: Cannot create activex component.

     

    Again. If I open the microsoft word as Administrator in the same environment the GetObject command succeded , but I received the error message: There was a problem sending the command to the program.

     

    Thank you for you help.

     

    Maymone D.


    IT Consultant

    Tuesday, August 2, 2011 11:11 AM

Answers

  • Hi Maymone;

    Your forum thread is in the VSTO thread. It’s in the wrong thread. Underlying both of your problems is some sort of glitch with your installation of Windows 7 – 64 bit.  When you try to open any Word 2007 file you get the message “there was a problem sending the command to the program.”  That is not expected behavior, and doesn’t happen on my own 64-bit Windows 7, nor on any other reported installation of 64-bit Windows 7.

    Here are some options for getting the problem addressed on your system – no guarantees for the first three options:

    1.       Uninstall Office 2007 then re-install it to see if that changes the registry and relieves the issue

    2.       Repair the Windows 7 installation

    3.       Add to the registry entry for HKEY_CLASSES_ROOT\WORD.APPLICATION.12\ so that it includes a
    HKEY_CLASSES_ROOT\WORD.APPLICATION.12\shell\open\ddeexec\ifexec   key with a default value of ().   See if that changes the behavior of double-clicking a docx file.

    4.       Repost your issue on the Windows 7 Forum

    5.       Open a paid support incident with Microsoft customer support. See the various paid support options that are available to better meet your need at http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    The engineer at Microsoft Customer Support will ask you for a demonstration either by looking at your desktop using Easy Assist or Live Meeting, or ask for a repro project to run on his system.  If the issue is caused by a Microsoft product bug, either in 64-bit Windows 7 or Microsoft Word there will be no charge for the support incident.

    Please post the results of your decision.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Wednesday, August 10, 2011 3:06 PM
    Moderator

All replies

  • Hi Maymone,

    Welcome to MSDN forums!

    Could you please let us know what's the 3rd party ActiveX component you are using?  What kind of VSTO are you using now?  A document level or application level?

    If you can provide us some sample codes of the issue, that would be very helpful for us to investigate the problem.

    Good day!

    Thanks 


    Michael Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Thursday, August 4, 2011 6:10 AM
    Moderator
  • Thank you for your response,

     

    As mentioned in my question, this is the code:

    oEAApp = CType(GetObject), EA_APPLICATION), EA.App) 

    EA_APPLICATION is a constant contaning : "EA.APP" : Enterprise Architect from Sparx corporation. It uses the "Interop.EA.dll".

    Worked perfectly in Windows XP environment.

    Again. If I open the microsoft word as Administrator and inside Microsoft Word I File/Open the document containing the VSTO, it is also running well in Windows 7. But if I double-click the word document in the windows explorer, the document is not opened. This error is displayed: There was a problem sending the command to the program.

    May be I need something like this: Opening the microsoft word not as administrator but running the VSTO code as administrator.

    Thanks agin


    IT Consultant
    Thursday, August 4, 2011 8:17 AM
  • Hello Maymone,

    Your issue sounds like two problems.  You haven’t said what version of Word your document was saved from – Word 2003, Word 2007 or Word 2010. That does make a difference.

    Please confirm this understanding of one of the problems: When you navigate through the Windows explorer to the Word document and double-click it you get the result is the error message “There was a problem sending the command to the program”
    This could be that the VSTO  Add-in’s initialization Connect code starts pumping messages before the Word application is loaded.  A workaround for this is to move the initialization Connect class’s constructor to onStartupComplete and GetCustomUI  methods.   

    This does not happen if you open Word, then open the document.  But when you execute your code it passes EA,app to the registry (via the get object) where it fails.  There could be more than one reasons for that -
    1. EA.app is not registered on the Windows 7 system
    2. ‘.app’ looks like a file extension. That may need a file type association but GetObject will look in the registry for the path to the application so the need for the file type association does not sound probable

    You can check for the registry issue by using some sample code from the Sparx site – see
    http://www.sparxsystems.com/enterprise_architect_user_guide/automation_and_scripts/app.html

    Also, User Account Control (UAC) may be a contributor – see the following:
    User Account Control in Windows 7 Best Practices
    http://technet.microsoft.com/en-us/library/ee679793(WS.10).aspx

    Please let us know if none of this helps.  Also respond with what fixes your issues in the event the answer is embedded in the suggestions above.

    Thanks,
    Chris Jensen
    Senior Technical Support Lead

    Thursday, August 4, 2011 4:58 PM
    Moderator
  • Hello,

    Thanks

    1. I am using Office 2007.

    2. If I check in the Properties of Microsoft Word in the Compatibility to "Run this program as an administrator", then opening any word document by doucle-click causes this error : There was a problem sending the command to the program. Even word documents that do not have any code behind (without VSTO). Just a simple document.

    3. Now, if the "Run this program as an administrator" is still checked and I open the Microsoft Word program, and after that from inside the program I open (with file/open) the word document with the VSTO. the document is opened successfully  and the VSTO containing the reference of the EA Activex is running successfully.

    4. If I uncheck the "Run this program as an administrator" and open the word document with the VSTO it is opening successfully without the message  There was a problem sending the command to the program. But running the VSTO code that contains the EA activex failed : "Cannot create activex component".

    5. I hope that now I explained myself clearly.

    6. Thank you again.


    IT Consultant
    Thursday, August 4, 2011 6:02 PM
  • Hello Maymone,

    The new aspects in your most recent post are

    1. You’re running in Word 97/2003 compatibility mode, and
    2. When not running as administrator and you double-click the .doc file in Windows explorer you do not get the problem message.
    3. When running as administrator and you load the document from within Word the GetObject(ea…. Call succeeds – implying that the 3
    <sup>rd</sup>-party application is registered.

    Is this correct?
    Do you have the same problems if you run on a Word 2003 machine?
    Please let me know the answers to the two questions above. Thanks.

    The issue may be one of UAC.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Friday, August 5, 2011 8:40 PM
    Moderator
  • Hello,

    1. Specifically, I am running Word 2007 with documents as docx,dotx, doc, dot...)  Not in Word 97/2003 Compatibility mode. When the "Run as Administrator" is checked I receive for all that doc types the same error:  There was a problem sending the command to the program.

    2. Yes, When not running as administrator and double-click the .doc file in Windows explorer I do not get the problem message.

    3. Yes, When running as administrator and I load the document from within Word the GetObject(ea…. Call succeeds – implying that the 3rd party application is registered. Yes the EA is registered.

    4. I disabled the UAC and still the same problem.

    5. Same problem in 2003.

    6. In Windows XP with exactly the same environment all was fine.

    7. Seems a Windows 7 issue.

    Thank you

    Maymone


    IT Consultant
    Monday, August 8, 2011 4:56 AM
  • Hello Maymone,

    A Question about the syntax of the code
    oEAApp = CType(GetObject), EA_APPLICATION), EA.App)

    Why isn’t this
    oEAApp = CType(GetObject(,EA_APPLICATION), EA.App)

    GetObject is followed by a list of arguments enclosed in parenthesis. If the object is not already loaded the first argument is omitted, or null (nothing) and the second argument is used to find the class in the registry.  The class is then created and loaded.

    CType( .type ) wraps the expression , defining early binding of the specific type. In your example you state the type is EA.App. You need the opening and closing parentheses marks.  Your syntax is short one opening parenthesis mark.

    I don’t know why your syntax works under some conditions and some operating systems, but suggest you try the conventional syntax.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Monday, August 8, 2011 8:52 PM
    Moderator
  • Hello Chris,

    Sorry! the syntax was always as you wrote. I was in RightToLeft mode when I copied it to the clipboard and paste it.

    Maymone

     


    IT Consultant
    Tuesday, August 9, 2011 5:18 AM
  • Hello Maymone,

    Since you encounter the message “There was a problem sending the command to the program” when you double-click any Word 2007 file (and I do not get it on my 64-bit Windows 7) try to find a Registry key similar to the following:
    HKEY_CLASSES_ROOT\Word.Application.12\shell\Open\ddeexec\ifexec

    If you find that key and the value is similar to “(SHELLNOOP)” change that value to “()”, or, after exporting the key, try removing it. It is optional.

    If your registry doesn’t have this key please let us know.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Tuesday, August 9, 2011 3:46 PM
    Moderator
  • Hello Chris,

    I do have HKEY_CLASSES_ROOT\Word.Application.12 in my registry but I do not have HKEY_CLASSES_ROOT\Word.Application.12\Shell

    Thanks

    Maymone


    IT Consultant
    Tuesday, August 9, 2011 4:10 PM
  • Hi Maymone;

    Your forum thread is in the VSTO thread. It’s in the wrong thread. Underlying both of your problems is some sort of glitch with your installation of Windows 7 – 64 bit.  When you try to open any Word 2007 file you get the message “there was a problem sending the command to the program.”  That is not expected behavior, and doesn’t happen on my own 64-bit Windows 7, nor on any other reported installation of 64-bit Windows 7.

    Here are some options for getting the problem addressed on your system – no guarantees for the first three options:

    1.       Uninstall Office 2007 then re-install it to see if that changes the registry and relieves the issue

    2.       Repair the Windows 7 installation

    3.       Add to the registry entry for HKEY_CLASSES_ROOT\WORD.APPLICATION.12\ so that it includes a
    HKEY_CLASSES_ROOT\WORD.APPLICATION.12\shell\open\ddeexec\ifexec   key with a default value of ().   See if that changes the behavior of double-clicking a docx file.

    4.       Repost your issue on the Windows 7 Forum

    5.       Open a paid support incident with Microsoft customer support. See the various paid support options that are available to better meet your need at http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    The engineer at Microsoft Customer Support will ask you for a demonstration either by looking at your desktop using Easy Assist or Live Meeting, or ask for a repro project to run on his system.  If the issue is caused by a Microsoft product bug, either in 64-bit Windows 7 or Microsoft Word there will be no charge for the support incident.

    Please post the results of your decision.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Wednesday, August 10, 2011 3:06 PM
    Moderator
  • Tried all of this without successfull results

    1.  Uninstalled Office 2007 then re-installed it 

    2.  Added to the registry entry for HKEY_CLASSES_ROOT\WORD.APPLICATION.12\ so that it includes a
    HKEY_CLASSES_ROOT\WORD.APPLICATION.12\shell\open\ddeexec\ifexec key with a default value of (). See if that changes the behavior of double-clicking a docx file.

    3. Reposted the issue on the Windows 7 Forum

     

    4. By the way I tried the same in another computer with Windows 7 Starter - 32 bits and the same problem occured

    Thank you

    Maymone

     


    IT Consultant
    Friday, August 19, 2011 4:22 AM
  • Hi Maymone,

    Thank you for posting the summary of your research. The Windows 7 Forum is the appropriate site for the issue. The moderator and experts in Windows 7 will be the best source of ideas about why double-clicking any Office fails to cause it to open in the designated application.  If you ultimately need to use the option of paid support the service request will be routed to the Windows 7 support team.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Monday, August 22, 2011 6:46 PM
    Moderator