Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2001
    Location
    Perth,(aka middle of nowhere), Western Australia, Australia
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add-in UDF's (2000)

    Can anyone explain why after saving my code as an add-in (it contains 7 UDF's) according to the instructions in this forum and also MS Q211563 I can't get at them - in fact I can't see them in the functions list anywhere.
    I install (Tools>Add-Ins) the add-in successfully and it appears in the list fine. I have tried restarting Excel and been through the process a number of times. If I unlock the add-in and select the "This Worksheet" item from the add-in in the VBA editor the code is all there?

    Any ideas why I can't see/get to it. <img src=/S/question.gif border=0 alt=question width=15 height=15>

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Add-in UDF's (2000)

    Hi,
    You shouldn't put your functions in the ThisWorkbook module, as it's a kind of class module and so your functions become methods of the class. Insert a normal module into your add-in and copy the code there and you should be OK. (You may want to explicitly declare your functions Public if you haven't already.)
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add-in UDF's (2000)

    Two things to check. First, as Rory pointed out, make sure the UDFs are in a General module, not in one of the modules behind a worksheet or behind the ThisWorkbook object. Second, also make sure the that UDFs are defined as Public not Private.
    Legare Coleman

  4. #4
    Lounger
    Join Date
    Aug 2001
    Location
    Perth,(aka middle of nowhere), Western Australia, Australia
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Add-in UDF's (2000)

    Rory and Legare,
    thanks.
    The UDF's were in fact in a general module - the reference to this worksheet was a miscommunication on my part.
    The only change I did - which worked - was explicitly declaring then public. As according to the VBA help, <font color=blue>"If not explicitly specified using Public, Private, or Friend, Function procedures are public by default"</font color=blue> I am not sure why this is absolutely necessary - <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> but hey it worked.

Posting Permissions

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