View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Return codes from called macros

Make the macro a function, and return a status code from that function. To
call it, use

rtn = Application.Run("'wkb'!myFunc")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"mwc0914" wrote in
message ...

I have my main macro that calls another macro via Application.Run
"Called Macro".

Within the called macro I attempt to have the user open a file so it
can be processed. If the user selects cancel when prompted & doesn't
open the file, I exit the called macro. But now I want my main macro to
know that this just happened so I can exit it also.

How do I pass return codes back from a called macro to the main macro &
reference the return code in the main macro?


--
mwc0914
------------------------------------------------------------------------
mwc0914's Profile:

http://www.excelforum.com/member.php...o&userid=24130
View this thread: http://www.excelforum.com/showthread...hreadid=558576