The information in this article applies to:
SUMMARY
In Microsoft Excel, if you call a subroutine (for example, TestSub) from
another Visual Basic subroutine, Microsoft Excel will search for the
subroutine in the current workbook and then it will search any libraries
and/or workbooks to which the current workbook has references (these
references will be searched in top-to-bottom order as they appear in the
References dialog box).
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.asp Steps to Reproduce Behavior
For example, if you follow the steps in the "Steps to Reproduce Behavior Section" above, you create references to both BRAVO.XLS and CHARLIE.XLS. The first time the Starter subroutine is run (step 14), Microsoft Excel finds the TestSub subroutine in ALPHA.XLS and runs it. The second time the Starter subroutine is run (step 16), Microsoft Excel does not find the TestSub subroutine in ALPHA.XLS (because it has been deleted). It then checks the referenced libraries and modules for the subroutine. The subroutine is first found in BRAVO.XLS, and so Microsoft Excel runs the TestSub subroutine located there. For more information on creating references and running subroutines located in other workbooks, see the "Visual Basic User's Guide," Chapter 4. REFERENCESFor additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base: Q163435 VBA: Programming Resources for Visual Basic for Applications Additional query words: 5.00a 5.00c 7.00a XL98 XL97 XL7 XL5
Keywords : kbprg kbdta kbdtacode PgmOthr KbVBA |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |