VBA unable to call Public Function from external Project RRS feed

  • Question

  • This will probably turn out to be one of those S.O.B.O. moments, but here goes . . . 

    I have a Public Function, called "GetFromAX", held within a Module , called "AXFunctions", within a Project, called "EventHandlerAddin.DOTM" , which is stored in the "\Microsoft\Word\STARTUP" folder.  (N.B. Word 2007)

    There are no Private Sub or Private Function statements anywhere within the STARTUP Project - so it is my understanding that I should be able to call my Public Function from VBA code held in another Project ( "X = GetFromAX(Parameter)" ): but I can't!  Instead I get the following message: "Compile Error: Sub or Function not defined".

    I feel as if I am missing something really obvious here.

    Several hours of internet searched have not revealed anything useful so I have decided to throw myself on your mercy.

    All suggestions / help will, as ever, be gratefully received.


    Paul J

    Monday, February 21, 2011 2:19 PM


  • Eureka!

    I gave the addin Project a name, added a Reference to it in the calling Project, and bingo!

    Paul J

    • Marked as answer by David Wolters Tuesday, February 22, 2011 3:26 PM
    Tuesday, February 22, 2011 9:17 AM