Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default execute macro in other workbook

Hi !

I can't find for the moment the VBA code to execute the sequence :
- open a workbook
- execute a macro stored in it

Thank you for your help

Best regards

Sylvain caillet


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default execute macro in other workbook

Hi Sylvain,

Try:

Application.Run "MyBook.xls!MyMacro"

If MyBook is not in the default directory, include the full path.

This will open MyFile.xls (if it is not open) and run its MyMacro routine.


---
Regards,
Norman



"Sylvain" wrote in message
...
Hi !

I can't find for the moment the VBA code to execute the sequence :
- open a workbook
- execute a macro stored in it

Thank you for your help

Best regards

Sylvain caillet



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default execute macro in other workbook

Post cancelled. Sorry

Sylvain
"Sylvain" a écrit dans le message de news:
...
Hi !

I can't find for the moment the VBA code to execute the sequence :
- open a workbook
- execute a macro stored in it

Thank you for your help

Best regards

Sylvain caillet



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default execute macro in other workbook

Workbooks.Open Filename:=wb_filename
Application.Run "'" & Activeworkbook.Name & "'!myMacro"

If the code is added to the workbook's Workbook_Open event, it will execute
automatically upon opening the workbook.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sylvain" wrote in message
...
Hi !

I can't find for the moment the VBA code to execute the sequence :
- open a workbook
- execute a macro stored in it

Thank you for your help

Best regards

Sylvain caillet




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
Auto execute upon workbook retrieval TOMD Excel Discussion (Misc queries) 0 February 7th 07 08:12 PM
Automatically execute a CTRL-ALT-F9 when I open a workbook Antonio Duarte Excel Discussion (Misc queries) 1 June 15th 05 02:48 PM
Execute Macro Yves Excel Discussion (Misc queries) 3 April 23rd 05 04:26 PM
How to execute macros not saved in a workbook David P.[_3_] Excel Programming 0 April 1st 04 02:51 AM
Execute program (macro?) upon opening a workbook Warren Excel Programming 3 February 19th 04 03:16 PM


All times are GMT +1. The time now is 08:03 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"