Sub with optional parameters not working

C

Carol G

I can call this sub from another sub and it works with or without actual
arguments being sent.
but if I try to run or step through it by itself my computer just beeps and
does not go into it at all. No error messages or anything.
I'm sure I'm just not understanding something about functions but I can't
figure it out.
Thanks
Carol

Sub Envelope2(Optional objWord As Object, Optional itm As ContactItem)
 
C

Carol G

Thanks, Carol

Eric Legault said:
Functions can never be run by themselves - they're always meant to be called
by other code and return something. Procedures can run by themselves but
only if they require no parameters. Procedures never "return" information
explicitly (although you can modify the values of any parameters that are
passed if they are decleared with the ByRef statement).

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top