Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Function in Macro 1

Status
Not open for further replies.

mkumar87

Technical User
Mar 22, 2010
2
IN
Hi ,

Can any one help me in using function in Macro's. I have created 2 small functions.

My doubt is " Is it possible to call the function from some other file.

For Ex. I have created 2 function named 1.Login 2.Testing

these 2 fucntions are saved in file name Login.ebm , Testing.ebm... Now is it possible to call this function in my third program name Call.ebm ?

Please let me know if you need more info..

 
Goal
Call a macro from another macro and return to original one.
Fix
In order to be able to call another macro and execute and return perform the following steps:
* 1) Create the originating macro,
2) use the '$Include statement with full path,
3) save this macro as a macro with the extension .EBM

* 1) Create the called macro
2) remove the 'Sub Main ()' and 'End Sub' statements
3) save it as a header file with the extension .EBH

Below is an example of This.EBM calling Other.EBH

This.EBM:
'$Include: "c:\temp\other.ebh"

Sub Main()
MsgBox "This macro"
Other
MsgBox "This macro"
End Sub

Other.EBH:
Sub Other()
MsgBox "Other macro"
End Sub
 
Thanks Bro..Its really helpful for me.. Let me try this out....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top