Form Macros not display at run macro screen
Hi,
I have form macros that do not display on the excel front end run macro - which should hold all your macros. This is frustating and time consuming because in order to run the macro I need to go into vba editor - click on forms and run the macro on the form. One of my macros creates a standard outlook mail but its run from excel vba. Do I need to add outlook references?
The form macro is executed by a command button with code below:
cmdMAIL_Click()
Appreciate if someone could detail precisely what I need to do to make it more convenient when running form macros. Please be precise on references.
Thanks very much,
Re: Form Macros not display at run macro screen
put all the macros in modules as public then you can call them from any form, as well as in the macro list
Re: Form Macros not display at run macro screen
Can you provide example - my code is written in form code via a command button mail. It not really a subroutine as the code is embedded within the command below. I also want this called up via personal .xls not public to everyone.
What exactly do I need to do - I am still confused how - need more details especially if I need to add vb sytax? Does anything in the form code need to change? Its not a module its form code.
cmdmail_click()
Can you help on my dynamic lookup post as well?
Many thanks,
Re: Form Macros not display at run macro screen
vb Code:
'in module
sub mytest()
msgbox "this is a test"
end sub
vb Code:
'in form
private sub cmdmail_click()
mytest
end sub
you can pass any required parameters if required
vb Code:
'in module
sub mytest(teststr as string)
msgbox teststr
end sub
vb Code:
'in form
private sub cmdmail_click()
mytest "this is a test"
end sub
note procedures that require parameters can not be run directly as macros anyway, as there is no way to pass the parameters