Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Run macro in another workbook with arguments

Run "AnotherWB.xls!MyProcedure", 5

Regards,
Tom Ogilvy


"Jos Vens" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Run macro in another workbook with arguments

Thanks Tom!

Jos

"Tom Ogilvy" schreef in bericht
...
Run "AnotherWB.xls!MyProcedure", 5

Regards,
Tom Ogilvy


"Jos Vens" wrote in message
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro - onAction arguments version83 Excel Worksheet Functions 2 April 10th 10 09:59 PM
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM
Question: Macro overloading, passing variable number of arguments Frederik Romanov Excel Programming 1 July 8th 03 02:51 PM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"