none
Run-time error '459': External exception while loading the COM control in the MS Excel UserForm RRS feed

  • Question

  • Hi

    I have created COM control and registered it in the 64 bit machine (also has 64 bit office)

    I am able to get the COM control in 64 bit office by registering assembly with 64 bit Regasm and then with 32 bit Regasm.

    I placed the COM control in the MS Excel UserForm.

    when i try to run the UserForm, I am getting "Run-time error '459: External Exception'"

    But the same COM control works fine without any error in 32 bit office in 32 bit machine.

    Any idea why i get this error in the 64 bit machine? Please help me to get rid of this error.

    I have uploaded my test solution under the below path.

    https://ksvimalraj.opendrive.com/files?NF81NDk5MzRfYmJuSXc

     



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.
    Tuesday, January 10, 2012 6:31 PM

Answers

  • danishani,

    The problem is solved by registering the dll with 64bit RegAsm first and followed by 32 bit RegAsm.

    in 64 bit machine Registering with both 64bit RegAsm and 32 bit RegAsm is must.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.
    • Marked as answer by ksvimal Monday, January 30, 2012 3:51 AM
    Monday, January 30, 2012 3:51 AM

All replies

  • Hi, I'm writing to let you know that I get other people help on this issue.

    More background information could be found here: http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/2dc469cd-4679-4ac7-b20f-d9680129140a

    Best Regards,


    Forrest Guo | MSDN Community Support | Feedback to us

    Thursday, January 12, 2012 2:27 AM
    Moderator
  • Hi ksvimal

    The thread at the following Forum is long, but sets the stage for being certain your COM control is registered.  This thread is yours and you posted one more issue at the end.

    How to register COM usercontrol in 64bit Windows 7 system?
    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/a6e4ba3c-c7b2-47e2-922c-9831f9718aad

    At the end the moderator provides the link to the correct forum for getting help with your error message.  It is to http://msmvps.com/blogs/p3net

    I downloaded your project and opened in Visual Studio 2010. In your code insert try…catch statements. When the exception is the error you are getting you can see the code that caused the problem.

    Here is another blog that may help:

    Using Managed Controls as ActiveX Controls - Andrew Whitechapel ...
    http://blogs.msdn.com/b/andreww/archive/2008/11/24/using-managed-controls-as-activex-controls.aspx

    The following may be useful to you:
    Understanding 64-bit versions of Office 2010 and related ...
    http://blogs.technet.com/b/odsupport/archive/2010/08/25/understanding-64-bit-versions-of-office-2010-and-related-deployment-considerations-advantages-and-disadvantages.aspx

    Understanding 64-Bit Office - Microsoft Office 2010 Engineering ...
    http://blogs.technet.com/b/office2010/archive/2010/02/23/understanding-64-bit-office.aspx?PageIndex=2

    This article says you can’t run the 32-bit and 64-bit versions of Office 2010 at the same time.

    Also please see:
    Compatibility Between the 32-bit and 64-bit Versions of Office 2010
    http://msdn.microsoft.com/en-us/library/ee691831.aspx

    In this article Frank Rice says:
    Existing 32-bit ActiveX controls, both third-party and Microsoft-supplied, are not compatible with the 64-bit version of Office 2010. For ActiveX controls and COM objects, there are three possible solutions:
    If you have the source code, you can generate a 64-bit version yourself,
    You can contact the vendor for an updated version,
    You can search for an alternative solution.

    Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar).These controls were installed by previous versions of Microsoft Office and are installed by 32-bit Office 2010. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010. 64-bit Office 2010 does not provide 64-bit versions of the Common Controls.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “unmark as answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.

    Regards,
    Chris Jensen
    Senior Technical Support Lead

    • Edited by cjatms Thursday, January 12, 2012 8:48 PM
    • Proposed as answer by danishaniModerator Wednesday, January 18, 2012 7:21 PM
    • Unproposed as answer by ksvimal Thursday, January 19, 2012 3:52 AM
    Thursday, January 12, 2012 8:47 PM
  • Hi ksvimal,

     

    How about the problem on your side? Do you still need any assistant about the problem?

     

    If you still show any concern on the problem, just feel free to let us know.
     

    Best Regards,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"
    Saturday, January 28, 2012 3:02 AM
    Moderator
  • danishani,

    The problem is solved by registering the dll with 64bit RegAsm first and followed by 32 bit RegAsm.

    in 64 bit machine Registering with both 64bit RegAsm and 32 bit RegAsm is must.

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This will help other members to find the solution easily.
    • Marked as answer by ksvimal Monday, January 30, 2012 3:51 AM
    Monday, January 30, 2012 3:51 AM