ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling Excel 4 Macros From VBA (https://www.excelbanter.com/excel-programming/321500-calling-excel-4-macros-vba.html)

Eloy[_2_]

Calling Excel 4 Macros From VBA
 
How can I call an Excel 4 macro from a VBA routine in the same workbook

Thanks,
Eloy

Tom Ogilvy

Calling Excel 4 Macros From VBA
 
To execute an Excel 4 macro command:
Application.ExecuteExcel4Macro
the help example:
MsgBox ExecuteExcel4Macro("GET.CELL(42)")

Otherwise, if the macro has a name (a macro you wrote in an excel 4 macro
sheet) then use Application.Run


Application.Run "Macro1!XL4_Code"

Here there is a cell named "XL4_Code" on the XL4 macro sheet named "Macro1".
The XL4 code begins at this cell.



--
Regards,
Tom Ogilvy



"Eloy" wrote in message
...
How can I call an Excel 4 macro from a VBA routine in the same workbook

Thanks,
Eloy





All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com