Consulting

Results 1 to 8 of 8

Thread: Application.MacroOptions: StatusBar property not working

  1. #1

    Application.MacroOptions: StatusBar property not working

    Please help me figure out how to make the StatusBar property work for registering my UDFs. The descriptions are working correctly and they are appearing in the correct categories, but for some reason the StatusBar text is not appearing. (Is there a character limit?) Thanks!

    Here is my sub to register them contained in the same module as my UDFs:

    [vba]Sub RegisterUDFs()
    Dim cF As String
    Dim C As String
    Dim PV As String
    Dim G As String

    cF = "Calculates the Country Risk Premium based on the Country Risk Curve." & vbLf _
    & "CurveFormula(<Country Risk Multiplier>)"
    C = "Calculates the CAGR of a range of values." & vbLf _
    & "CAGR(range)"
    PV = "Calculates the total of the Present Values of a range of cash flows." & vbLf _
    & "PVsum(range,[periods/yr])"
    G = "Calculates Avg. Growth of a range of values following break-even." & vbLf _
    & "AvgGrowth(range)"

    Application.MacroOptions Macro:="CurveFormula", Description:=cF, Category:=5, StatusBar:="CurveFormula(range) / Calculates the Country Risk Premium based on the Country Risk Curve."
    Application.MacroOptions Macro:="CAGR", Description:=C, Category:=1, StatusBar:="CAGR(range)"
    Application.MacroOptions Macro:="PVsum", Description:=PV, Category:=1, StatusBar:="PVsum(range,[integer (periods/yr)]) / Calculates the total of the Present Values of a range of cash flows."
    Application.MacroOptions Macro:="AvgGrowth", Description:=G, Category:=1, StatusBar:="AvgGrowth(range) / Calculates Avg. Growth of a range of values following break-even."
    End Sub[/vba]

    Here is what I have placed in my 'ThisWorkbook' object:

    [vba]Private Sub Workbook_Open()
    RegisterUDFs
    End Sub[/vba]

    P.S. Am I correct in assuming that every time the workbook is re-opened the UDFs need to be registered again? (I also assume that I should unregister them on Workbook_Close, correct?)
    Last edited by greglittle; 10-18-2012 at 02:54 PM.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Yes, there is a character limit to macrooptions. More importantly, you can not have multiple lines in the statusbar.

  3. #3
    I am not trying to put multiple lines in the statusbar. Is the '/' being interpreted by VBA as a NL?

    [vba]Application.MacroOptions Macro:="AvgGrowth", Description:=G, Category:=1, StatusBar:="AvgGrowth(range) / Calculates Avg. Growth of a range of values following break-even."[/vba]

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    According to ...


    http://my.safaribooksonline.com/book...xcel-chp-7-109

    'StatusBar' is ignored

    I tried some built in Functions, and they didn't display a SB either

    Paul

  5. #5
    So is there any other way to have a tooltip appear for a UDF?

  6. #6
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    No.

    Press Shift+F3 after typing the function name and the "(" to get to the description dialog.

    If you need a longer description, that can be done but it is much more involved than macrooptions.

  7. #7
    Kenneth, thanks, but I am not having any problems with the description dialog box. It works just fine and I do not need a longer description. What I am having problems with is getting the tooltip to pop-up when the function is written. I thought that was done through the statusbar property, but apparently not b/c even if I put in a very short string the tooltips don't work. The images below show what I am trying to make work for my UDFs.

    Any ideas how? Thanks.




  8. #8
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    So is there any other way to have a tooltip appear for a UDF?
    No.

Posting Permissions

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