Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Calling excel macro not located in that workbook.


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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calling excel macro not located in that workbook.

Hi cr113

You can use Application.run

Application.Run "YourFile.xls!YourMacro"

--

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


"cr113" wrote in message ...

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Calling excel macro not located in that workbook.

On Apr 1, 4:15*pm, "Ron de Bruin" wrote:
Hi cr113

You can use Application.run

Application.Run "YourFile.xls!YourMacro"

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm



"cr113" wrote in ...

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
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
Open PDF located in excel with macro Ken Excel Programming 7 January 31st 08 07:05 PM
Calling a Macro from another workbook JohnJack Excel Programming 3 November 27th 07 08:13 PM
Calling up the macro dialog to list stored macros in a workbook-VB mason Excel Programming 1 March 22nd 07 09:07 PM
How to reference a Class Module located in an add-in or another workbook? keithb Excel Programming 1 September 10th 05 01:40 AM
Close current Workbook after calling macro in other Des Janke Excel Programming 4 August 7th 03 07:33 AM


All times are GMT +1. The time now is 03:00 AM.

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

About Us

"It's about Microsoft Excel"