Results 1 to 3 of 3
  1. #1
    JustCallMeAl
    Guest

    Naming Macros for Functions

    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.

  2. #2
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Naming Macros for Functions

    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:
    <pre>Declare Function EssVConnect Lib "ESSEXCLN.XLL" ( _
    ByVal sheetName As Variant, ByVal username As Variant, _
    ByVal password As Variant, ByVal server As Variant, _
    <font color=magenta>ByVal application As Variant</font color=magenta>, ByVal database As Variant) _
    As Long
    </pre>

    Now I personally think that's pretty sloppy, especially given the <img src=/S/money.gif border=0 alt=money width=17 height=15> 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

  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Willow Grove, Pennsylvania, USA
    Posts
    205
    Thanks
    4
    Thanked 49 Times in 40 Posts

    Re: Naming Macros for Functions

    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? <img src=/S/yikes.gif border=0 alt=yikes width=15 height=15>

Posting Permissions

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