Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Order of Precedence (VBA 6)

    I've seen it written somewhere, but cannot find it now.
    When calling a procedure; what are the rules controlling where the calling procedure looks first, and then if unsuccessful, and so on?
    Can anyone point me in the correct drection?
    Regards
    Don

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Order of Precedence (VBA 6)

    This might depend on the host application. In Word, an identically named procedure in the relevant document (whichever one is in scope) will be called first, followed by its attached template, and then the global containers. I forget the precise order among them, but it should be relatively easy to track down. What application are you programming?

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Order of Precedence (VBA 6)

    In this instance I'm working in Word, however my need-to-know is equally relevant in Excel. Thanks for the help.
    Regards
    Don

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Order of Precedence (VBA 6)

    Here are Microsoft's general comments on Word 97:
    <hr>The definition or setting that takes precedence is the one that resides closest to the document. Therefore, Word resolves such conflicts in the following order of priority:
    1. <LI>Template attached to the active document
      <LI>Normal template
      <LI>Additional global templates
      <LI>Add-ins
      <LI>Application layer
    If several global templates have conflicting settings, Word resolves the conflicts in the order in which the templates are listed in the Templates and Add-Ins dialog box (Tools menu). Templates in the Word Startup folder appear at the top of the list and have a higher priority. Subsequent ranking on the list is determined by alphabetic order.

    "Microsoft Word Architecture," Microsoft Office Resource Kit for Office 97<hr>
    Presumably this is similar for later versions, but I haven't searched much further. You can visit the Office Developer Center on MSDN at http://msdn.microsoft.com/office/ or the Office Solutions section of the MSDN Library for lots more information.

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Order of Precedence (VBA 6)

    Thank you again
    Regards
    Don

Posting Permissions

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