Consulting

Results 1 to 8 of 8

Thread: Cant access functions from a VBA add in

  1. #1
    VBAX Newbie
    Joined
    Jun 2014
    Posts
    3
    Location

    Cant access functions from a VBA add in

    Hi

    I have received an excell add in containing VBA code. I have installed the add in, so that when i open excel and press Visual Basic tab then i can see all the code. However when I chose a cell in excel and start typing in the name of a function from the add in then the relevant function doesnt show up. What sohuld I do?

    Thanks
    Andy

  2. #2
    are the functions public?

  3. #3
    VBAX Newbie
    Joined
    Jun 2014
    Posts
    3
    Location
    Yes, in the VBA code all functions start with "public function" if thats what your asking.
    Thanks

  4. #4
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    Are those functions in a macromodule in the AddIn ?

  5. #5
    VBAX Newbie
    Joined
    Jun 2014
    Posts
    3
    Location
    Yes they are in a module
    thanks

  6. #6
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,729
    Location
    Try this in the cell on the worksheet and see if it works ..

    =MyAddin.xlam!MyFunction(b2)
    
    or if there are spaces
    
    ='My Addin has spaces.xlam'!MyFunction(b2)  (I think that's the proper format)
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Does the module have Option Private Module at the top?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    Which version of Excel do you have?
    Be as you wish to seem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •