• Naming Macros for Functions

    Author
    Topic
    #1769784

    Didn’t know whether to put this here or in the Word forum. Guess you can figure out what one I chose……

    Had an interesting challenge. A user (in Word97 SR2) was having compile errors pop up on her. However, when others performed the same task, no compile errors.

    Finally this morning, I set my user templates path to her normal.dot, and the compile error appeared. I finally found where the problem was, it was with the Format function. The error stated that an improper number of parameters were being sent. When I looked at the helps for Format, all parameters except one were optional; and the command in the code contained at least one parameter.

    What’s the problem????

    I finally noticed that she had a NewMacros module in her normal. When I looked in it, I found a macro named, yup, you guessed it, Format–with NO parameters! Hence the error.

    I remember some discussion about using a prefix, i.e., udf_, for macro names. This is a case where the need for either better macro naming on the user’s part or using udf_ wouldn’t have created the problem.

    I have now sent out instructions to all our users to please use udf_ in front of macro names which they record.

    Viewing 0 reply threads
    Author
    Replies
    • #1784529

      Edited by Charlotte to fix horizontal scrolling
      On a similar note but in excel, anyone using the Hyperion/Arbor Essbase addin and coding the custom functions may be wondering why their intellisense has gone to pot – eg:

      application.ScreenUpdating = False

      instead of

      Application.ScreenUpdating = False

      that in itself isn’t that bad, but sometimes you get the little auto-complete boxes, sometimes you don’t. Never worked out why, and I’m also too embarrassed to admit to how long it took me to track it down to the following call to one of the addin’s functions:

      Declare Function EssVConnect Lib "ESSEXCLN.XLL" ( _
            ByVal sheetName As Variant, ByVal username As Variant, _
            ByVal password As Variant, ByVal server As Variant, _
            ByVal application As Variant, ByVal database As Variant) _
                            As Long 
      

      Now I personally think that’s pretty sloppy, especially given the money we hand over for the use of said product, but what do you all think about it? What sort of problems would you expect – if any – to result from this? Incidentally, I changed application to EssbaseApp in the above call but although the custom functions still work, my intellisense didn’t recover (story of my life!) Any explanations for that one?

      Brooke

      • #1784641

        Nice catch, Brooke. I don’t have Essbase, so I can’t check, but…

        Having found one reserved word used as a parameter name, are you sure there aren’t others? yikes

    Viewing 0 reply threads
    Reply To: Naming Macros for Functions

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: