View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jos Vens Jos Vens is offline
external usenet poster
 
Posts: 52
Default Run macro in another workbook with arguments

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