XL: Clarification of Caller Property HelpLast reviewed: December 1, 1997Article ID: Q141784 |
The information in this article applies to:
SUMMARYIn Microsoft Excel, the Caller Property Help topic in Microsoft Visual Basic for Applications Help contains the following statement:
If you need to write a macro which behaves differently based on whether it is called from a button or a menu item, you should specify an argument for the macro in the Assign Macro To Object... dialog box.To help clarify this statement, follow the steps in the "Example" section in the "More Information" section of this article. These steps show you how to create a procedure that takes an argument. The steps also show you how to specify a value for an argument when you assign the procedure to an object.
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 engineers 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/refguide/default.asp Example
You can use information functions such as IsObject or Isarray to check the type of returned values to determine what called the macro. When you use an argument to tell the procedure what called it (menu, tool, or button), your code is designed such that it can tell what kind of result it will get from Caller, and it can use that information to determine what else to do.
REFERENCES"Microsoft Excel 5 Visual Basic for Applications Reference," Microsoft Press, pages 88-89 For more information about the Caller property, choose the Search button in Help and type:
Caller Property |
Additional query words: 5.00 help file
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |