+ Reply to Thread
Results 1 to 8 of 8

Thread: inline function help?

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    inline function help?

    I am writing some VB macros in Excel 2007 (VB 6.5). In the Excel window, if I type in a conventional function (=MIN, =MAX, etc.) the tool will begin to auto-complete the list of functions. My functions also appear in this list (good so far). However, when I double click on the function name I would like to get a similar help dialog that I would get with the included Excel functions. For example, when double clicking on MIN a little comment containing MIN(number1, [number2], ...) pops up to let the user know what arguments are required and in what order. I would like a similar feature for the functions that I'm creating. Is this possible?

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: inline function help?

    If you want tooltips, then no. If you want the function wizard, then see the article DO linked to.

  4. #4
    Registered User
    Join Date
    09-29-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: inline function help?

    Thanks guys, I have implemented the code and got it working. However, I would like to future-proof myself by using the Excel2010 ArguementDescriptions option in Application.MacroOptions. My problem is that I get a compile error with the code below. I am looking at compiler directives (change if/else/end to # statements) but can't figure out a way to get the Excel Version prior to compile. Any thoughts?

    Public Sub ApplyDescription(FuncName As String, FuncDesc As String, Category As String, ParamArray ArgDesc() As Variant)
       If (Val(Application.Version) >= 14) Then
         Application.MacroOptions _
           Macro:=FuncName, _
           Description:=FuncDesc, _
           Category:=Category
       Else
         Application.MacroOptions _
           Macro:=FuncName, _
           Description:=FuncDesc, _
           Category:=Category, _
           ArgumentDescriptions:=ArgDesc
       End If
    End Sub

  5. #5
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,298

    Re: inline function help?


  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: inline function help?

    @MarvinP

    The Formula AutoComplete will not display tooltips for anything other functions in .xll

    Quoting the blog you referenced:

    Quote Originally Posted by David Gainer 21 Oct 2005 7:01 PM
    ...if you write UDFs using XLLs, we will display the function description as a tooltip. VBA and automation add-in UDFs will not have descriptive tooltips.
    Quote Originally Posted by David Gainer 25 Oct 2005 11:18 PM
    We only show the UDF function name in the Auto complete drop down list ... we don't auto complete any UDF arguments
    Last edited by DonkeyOte; 09-30-2010 at 04:06 PM. Reason: added note that post related to Marvin's link (rather than to OP)

  7. #7
    Registered User
    Join Date
    09-29-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: inline function help?

    I think there is some confusion. I have fully resolved my original question and am wondering about compile time directives (can I get the Excel version number). I will start a new thread.

    Thanks for everyone's help!

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: inline function help?

    You've got your If ..End if the wrong way round, but I think what you want is actually conditional compilation (#VBA7 is the constant you want)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0