Run macro in another workbook with arguments

  • Thread starter Thread starter Jos Vens
  • Start date Start date
J

Jos Vens

Hi,

is it possible to run a macro in another workbook which receives arguments?
Let's say I have two workbooks open: The calling wb is WB.xls and the
procedure I want to run is in the workbook AnotherWB.xls. Without
arguments, everything works fine but if that MyProcedure is

'Procedure is part of AnotherWB.xls

Sub MyProcedure (vArg as integer)

for i=1 to vArg
msgbox (i)
next

end sub

I am not able to do this in worbook WB.xls

Run "'AnotherWB.xls'!MyProcedure, 5"

Am I doing something wrong???

Thanks
Jos Vens
 
Back
Top