XL: Calling a Microsoft Excel Macro from a Lotus 1-2-3 MacroLast reviewed: December 17, 1996Article ID: Q119882 |
The information in this article applies to:
SUMMARYA macro written for Lotus 1-2-3 may be modified to run a Microsoft Excel macro in order to perform specific functions. In order to use the existing Lotus 1-2-3 macro and incorporate the Microsoft Excel macro, modify the Lotus 1-2-3 macro to include the Lotus 1-2-3 macro command XLCALL or XLBRANCH.
MORE INFORMATIONTwo Lotus 1-2-3 macro commands, XLCALL and XLBRANCH allow the you to run a Microsoft Excel macro from a Lotus 1-2-3 macro. The format of the commands are {XLCALL xl_macro_name} or {XLBRANCH xl_macro_name}. The XLCALL command will call the macro (xl_macro_name), then return control to the Lotus 1-2-3 macro that called it. The XLBRANCH command will call the macro (xl_macro_name) but will not return control to the originating macro. NOTE: In Microsoft Excel 97, the syntax to run a Microsoft Excel macro is {XLCALL ThisWorkbook.macroname}. The {XLCALL} and {XLBRANCH} commands are not available to versions of Microsoft Excel earlier than version 4.0 because these products did not use the Microsoft Excel macro interpreter. For example, if you created a macro named PagePrint to set your headers and footers on a macro sheet named PRINT.XLM and you want to call the macro from within one of your 1-2-3 macros, you can do this by inserting the command {XLCALL PRINT.XLM!PagePrint} within your 1-2-3 macro. Using a Visual Basic, Applications Edition, macro, the 1-2-3 macro would be written {XLCALL module1.PagePrint}. As with any subroutine, after the Microsoft Excel macro runs, control of the macro returns to the 1-2-3 macro. With XLBRANCH, you branch to Microsoft Excel and do not return to the 1-2-3 macro. NOTE: A Lotus 1-2-3 macro cannot be run from a Microsoft Excel macro. Lotus and 1-2-3 are registered trademarks of Lotus Development Corporation.
REFERENCES"Microsoft Excel Users Guide", version 5.0, page 38 "Switching to Microsoft Excel from Lotus 1-2-3," version 5.0, page 34
|
KBCategory: kbprg kb3rdparty
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |