Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 507413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:48:06+00:00 2026-05-13T06:48:06+00:00

I have asked this elsewhere, but have never found anyone knows how to build

  • 0

I have asked this elsewhere, but have never found anyone knows how to build an add-in for VBA IDE using VB.NET. Is it even possible? Could someone point me to an example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:48:07+00:00Added an answer on May 13, 2026 at 6:48 am

    It is possible you need to write a com addin using IDTExtensibility2 interface, select the shared addin project template from new project.

    EDIT

    Otherwise to create this addin from scratch you will need to do the following:

    1. Create a new project class library
    2. Add references to “Extensibility”, it should be in the list. You may need to download the PIAs for your version of office. (and perhaps VSTO but i am unsure on this point)
    3. Add references to “Microsoft.Vbe.Interop” again should be with the PIAs.
    4. Check the box “Register for Com Interop” in the properties tab.
    5. OPTIONAL In the debug settings tab change the startup to external program and enter the path to the excel exe in the programfiles folder (if this is intended for excel) this is to allow the project to be debuggable.
    6. OPTIONAL In the command options add a entry to a worksheet, or word doc that will show the addin dialog using a macro on startup, for development this makes sense to streamline the debugging experience. eg “C:\vbe.xlsm”
    7. OPTIONAL Also set the startup path to the worksheet directory eg “C:\”
    8. Implement the interface “IDTExtensibility2” found in “Extensibility” assembly.
    9. Call this class “Connect” (this is just a preference)
    10. Attribute the class with the following

    [ComVisible(true),
    Guid(“YourGeneratedGuid”),
    ProgId(“YourAddinName.Connect”)]

    Heres an implementation to get you started, Firstly replace the “YourAddinName” with your AppName and Create a Guid for “YourGeneratedGuid”.
    You will need to register the Addin into the right Registry location, see the registry keys that follow to get an idea, also replace some vars in the registry keys.

    Imports System
    Imports System.Drawing
    Imports System.Linq
    Imports System.Runtime.InteropServices
    Imports Extensibility
    Imports Microsoft.Vbe.Interop
    
    Namespace VBEAddin
    
    
    ''' <summary>
    ''' The object for implementing an Add-in.
    ''' </summary>
    ''' <seealso class='IDTExtensibility2' />
    <Guid("YourGeneratedGuid"), ProgId("YourAddinName.Connect")> _ 
    Public Class Connect
        Implements IDTExtensibility2
        Private _application As VBE 'Interop VBE application object
    
    
        #Region "IDTExtensibility2 Members"
    
        ''' <summary>
        ''' Implements the OnConnection method of the IDTExtensibility2 interface.
        ''' Receives notification that the Add-in is being loaded.
        ''' </summary>
        ''' <param term='application'>
        ''' Root object of the host application.
        ''' </param>
        ''' <param term='connectMode'>
        ''' Describes how the Add-in is being loaded.
        ''' </param>
        ''' <param term='addInInst'>
        ''' Object representing this Add-in.
        ''' </param>
        ''' <seealso class='IDTExtensibility2' />
        Public Sub OnConnection(ByVal application As Object, ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, ByRef [custom] As Array)
        _application = CType(Application,VBE)
        End Sub
    
        Private Sub onReferenceItemAdded(ByVal reference As Reference)
            'TODO: Map types found in assembly using reference.
        End Sub
    
        Private Sub onReferenceItemRemoved(ByVal reference As Reference)
            'TODO: Remove types found in assembly using reference.
        End Sub
    
    
        Private Sub BootAddin()
            'Detect change in active window. 
        End Sub
    
        ''' <summary>
        ''' Implements the OnDisconnection method of the IDTExtensibility2 interface.
        ''' Receives notification that the Add-in is being unloaded.
        ''' </summary>
        ''' <param term='disconnectMode'>
        ''' Describes how the Add-in is being unloaded.
        ''' </param>
        ''' <param term='custom'>
        ''' Array of parameters that are host application specific.
        ''' </param>
        ''' <seealso class='IDTExtensibility2' />
        Public Sub OnDisconnection(ByVal disconnectMode As ext_DisconnectMode, ByRef [custom] As Array)
        End Sub
    
        ''' <summary>
        ''' Implements the OnAddInsUpdate method of the IDTExtensibility2 interface.
        ''' Receives notification that the collection of Add-ins has changed.
        ''' </summary>
        ''' <param term='custom'>
        ''' Array of parameters that are host application specific.
        ''' </param>
        ''' <seealso class='IDTExtensibility2' />
        Public Sub OnAddInsUpdate(ByRef [custom] As Array)
        End Sub
    
        ''' <summary>
        ''' Implements the OnStartupComplete method of the IDTExtensibility2 interface.
        ''' Receives notification that the host application has completed loading.
        ''' </summary>
        ''' <param term='custom'>
        ''' Array of parameters that are host application specific.
        ''' </param>
        ''' <seealso class='IDTExtensibility2' />
        Public Sub OnStartupComplete(ByRef [custom] As Array)
            'Boot dispatcher
    
        End Sub
    
    
        ''' <summary>
        ''' Implements the OnBeginShutdown method of the IDTExtensibility2 interface.
        ''' Receives notification that the host application is being unloaded.
        ''' </summary>
        ''' <param term='custom'>
        ''' Array of parameters that are host application specific.
        ''' </param>
        ''' <seealso class='IDTExtensibility2' />
        Public Sub OnBeginShutdown(ByRef [custom] As Array)
        End Sub
    
        #End Region
    End Class
    End Namespace
    

    Here is the registry .key script to register the Addin, note you will need to change some of the settings in order to register it properly.

    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\VBA\VBE\6.0\Addins\YourAddinName.Connect]
    "CommandLineSafe"=dword:00000000
    "Description"="Description for your new addin"
    "LoadBehavior"=dword:00000000
    "FriendlyName"="YourAddinName"
    
    
    [HKEY_CLASSES_ROOT\CLSID\{YourGeneratedGuid}]
    @="YourAddinName.Connect"
    
    [HKEY_CLASSES_ROOT\CLSID\{YourGeneratedGuid}\Implemented Categories]
    
    [HKEY_CLASSES_ROOT\CLSID\{YourGeneratedGuid}\InprocServer32]
    @="mscoree.dll"
    "ThreadingModel"="Both"
    "Class"="YourAddinName.Connect"
    "Assembly"="YourAssemblyNameFullTypeName"
    "RuntimeVersion"="v2.0.50727"
    "CodeBase"="file:///PathToAssembly"
    
    [HKEY_CLASSES_ROOT\CLSID\{YourGeneratedGuid}\ProgId]
    @="YourAddinName.Connect"
    

    NOTE the tokens “YourGeneratedGuid” must have the curly braces {} included and be the same as the Guid in the attrib above, the token “YourAssemblyNameFullTypeName” must be the Assembly full name, the token “YourAddinName.Connect” must be the same ProgId set in the attrib above.

    SIDE NOTE

    Also found this helpful, might save you couple hours googling.

    'HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common
    'FontFace=Courier New (STRING - Default if missing)
    'FontHeight=10 (DWORD - Default if missing)                
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this has been asked elsewhere. I have looked but can't find any
I have asked this question before but did not get the satisfied answer as
I have asked this before but I didn't get the question right so the
I have asked this on the castle list as i'm using the nh facility
i asked this question yesterday but it doesnt seem to have asked properly so
I have just asked this question an hour ago but with regards to IE8
I'm sure others have already asked this, but is it possible to insert an
I don't know if this has been asked and answered elsewhere, but I could
I have asked this question before, but have not received any real answer. How
I have asked this question before but I haven't got an answer, so I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.