View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Calling procedure from another WKB with parameters

Ajit,

Try calling like this

Application.Run "book2.xls!test_msgbox", 4, 8

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ajit" wrote in message
...
I have two wkb's say Book1.xls and book2.xls

from book1 I am calling a procedure(with arguments : Run
"book2.xls!test_msgbox(4,8)"


sub in book 2 is :
Sub test_msgbox(int_1 As Integer, int_2 As Integer)
int_1 = int_1 + 2
int_2 = int_2 + 3
MsgBox int_1 + int_2
End Sub

msgbox comes up twice. It comes up once with result 17 and after i hit OK

it
is still there. Second time when i hit OK..msgbox closes.

But if i refer to a procedure without passing any values it works fine.

Any ideas what could be the reason. and how could it be rectified.

Thanks,
Ajit


--
Ajit