PC Review


Reply
Thread Tools Rate Thread

Calling excel macro not located in that workbook.

 
 
cr113
Guest
Posts: n/a
 
      1st Apr 2008

Can I call an excel macro programmatically from another workbook in
Excel 2003?

For example suppose I have 2 workbooks, book1.xls and book2.xls:


book1.xls
module1
macro1

book2.xls
module2
macro2

How would I call book2.module2.macro2 from book1.module1.macro1?
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      1st Apr 2008
Hi cr113

You can use Application.run

Application.Run "YourFile.xls!YourMacro"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"cr113" <(E-Mail Removed)> wrote in message news:156c1698-a01b-44f6-85f0-(E-Mail Removed)...
>
> Can I call an excel macro programmatically from another workbook in
> Excel 2003?
>
> For example suppose I have 2 workbooks, book1.xls and book2.xls:
>
>
> book1.xls
> module1
> macro1
>
> book2.xls
> module2
> macro2
>
> How would I call book2.module2.macro2 from book1.module1.macro1?

 
Reply With Quote
 
cr113
Guest
Posts: n/a
 
      1st Apr 2008
On Apr 1, 4:15*pm, "Ron de Bruin" <rondebr...@kabelfoon.nl> wrote:
> Hi cr113
>
> You can use Application.run
>
> Application.Run "YourFile.xls!YourMacro"
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "cr113" <cr...@hotmail.com> wrote in messagenews:156c1698-a01b-44f6-85f0-(E-Mail Removed)...
>
> > Can I call an excel macro programmatically from another workbook in
> > Excel 2003?

>
> > For example suppose I have 2 workbooks, book1.xls and book2.xls:

>
> > book1.xls
> > * *module1
> > * * * *macro1

>
> > book2.xls
> > * *module2
> > * * * *macro2

>
> > How would I call book2.module2.macro2 from book1.module1.macro1?- Hide quoted text -

>
> - Show quoted text -


I had to do a workbooks.open "book2" first, but it worked.

Thanks!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open PDF located in excel with macro Ken Microsoft Excel Programming 7 31st Jan 2008 07:05 PM
Calling a Macro from another workbook JohnJack Microsoft Excel Programming 3 27th Nov 2007 08:13 PM
Calling up the macro dialog to list stored macros in a workbook-VB =?Utf-8?B?bWFzb24=?= Microsoft Excel Programming 1 22nd Mar 2007 09:07 PM
Keeping a macro running after the calling workbook is closed (XL2K) Simon C Microsoft Excel Discussion 5 25th Oct 2005 05:53 PM
Close current Workbook after calling macro in other Des Janke Microsoft Excel Programming 4 7th Aug 2003 07:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:15 PM.