64 bit COM Add-in for VBA IDE using IDTExtensibility2

Proposed Answer 64 bit COM Add-in for VBA IDE using IDTExtensibility2

  • 2012年3月1日 9:08
     
     

    Hi All,

    Is it possible to develop an add-in for the VBA IDE for Office 64-bit? To be precise, I have a .NET .dll that I have compiled for AnyCPU. I can deploy it to a machine running 64-bit Windows/32-bit Office and it runs perfectly. If I deploy it to a machine running 64-bit Windows/64-bit Office, my add-in just gets ignored - no error messages appear and the LoadBehavior in the registry does not change.

    Has anyone successfully written or deployed a COM add-in for the VBA IDE in Office 64-bit?

    Thanks,

    Chris

全部回复

  • 2012年3月2日 0:43
     
     

    Chris,

    I suggest that You carefully read the following article on the subject:

    Deploying COM Add-ins for 64-bit Office using Visual Studio


    Kind regards, Dennis (http://xldennis.wordpress.com/)

  • 2012年3月2日 8:21
     
     

    Hi Dennis,

    I have read that article a few times. It deals more with installing add-ins for the main Office application, rather than into the VBA IDE. 

    To take a more specific view of the problem, if I place the normal entries (Description, LoadBehavior = 3, etc) under HKEY_CURRENT_USER\Software\Microsoft\VBA\VBE\6.0\Addins\MyAddin.Connect, should this not at least generate an error message when the IDE opens?

    I am beginning to wonder if the 64-bit VBE just doesn't try to  load add-ins.

    Chris

  • 2012年3月6日 1:15
    版主
     
     

    Hi Chris,

    Thank you for posting and how about the problem on your side?

    I will help you involve others to help you. There might be some delay about the response. Appreciate your patience.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年3月6日 2:23
     
      包含代码

    Chris,

    I have not forgotten You. When 2010 x64 was launched I tested my own free COM add-in and it works as expected. Now that I re-test it behaves identical to Your's add-in. So I'm confused what may cause it. I know it exist for running Excel 2003 on Windows Vista which prevent us to access the VBE.

    Just as a test, create a WinForm solution that automate Excel, on the WinForm add a button and then add the following code to it's click event:

            Dim xlApp As New Excel.Application
    
            Try
    
                MessageBox.Show(xlApp.CommandBars(1).Name.ToString())
    
                MessageBox.Show(xlApp.VBE.CommandBars(1).Name.ToString())
    
                With xlApp
                    .UserControl = True
                    .Visible = True
                End With
    
            Catch ex As Exception
    
                MessageBox.Show(ex.Message.ToString())
    
            End Try
            
    

    Make sure that the Import statements are added on top of the module. When executing the code what will the outcome be?

    Kind regards, Dennis (http://xldennis.wordpress.com/)

  • 2012年3月6日 11:56
     
     

    Hi Dennis,

    I'm not sure whether I'm happier for knowing that you have the same problem, or more sad!

    Good thinking on the simple VBE automation. Unfortunately My 64-bit computer has stopped working; I have a new one on the way. It will probably be Thursday before I can run the code you supplied. I will let you know the result.

    Regards,

    Chris

  • 2012年3月6日 12:05
     
     

    Hi Bruce,

    Good to see you! It looks as though Dennis can see a similar problem and I will continue testing once my new computer arrives.

    To sum up the question - is it possible to load an add-in into the VBA IDE for Office 64 bit? I have placed an entry under HKEY_CURRENT_USER\Software\Microsoft\VBA\VBE\6.0\Addins\MyAddin.Connect that includes a value LoadBehaviour of 3.

    If I then open up Excel and use ALT + F11 to go to the VBA IDE, I would expect the VBA IDE to either

    - load the add-in or

    - give me an error message to tell me that the add-in could not be loaded for some reason.

    However, I am finding that it does neither - it is almost like the VBA IDE is not looking for add-ins to load?

    Is this expected behaviour in Office 2010 64-bit? Perhaps there is a slightly different registry key that I should use for 64-bit Office?

    Note that the add-in loads into the VBA IDE perfectly if I run Office 2010 32-bit on a 64-bit Windows machine.

    Regards,

    Chris

  • 2012年3月6日 13:27
     
     

    Chris,

    It has nothing to do with emotions. The point here is that I can reproduce the error.

  • 2012年4月12日 20:35
     
     建议的答复

    Hi Chris,

    I haven't worked on add-ins for VBA. But I checked using Process monitor for where office 64-bit search for VBA add-ins and I see that it looks for HKEY_CURRENT_USER\Software\Microsoft\VBA\VBE\6.0\Addins64 . 

    Thanks,


    Shiv Khare