Sub with optional parameters not working

  • Thread starter Thread starter Carol G
  • Start date Start date
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)
 
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/
 
Back
Top