Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Calling a macro from a closed file

Hi all!

Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.

Any help would be much appreciated.

Peter

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Calling a macro from a closed file

Hi Peter,

See the Run method and example in VBA help.


---
Regards,
Norman


"Peter" wrote in message
oups.com...
Hi all!

Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.

Any help would be much appreciated.

Peter



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calling a macro from a closed file

You must open the file to run a macro
Why not add the macro in your personal.xls file so you can use it in all your workbooks.
See http://www.rondebruin.nl/personal.htm

Or is there a other reason

--

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


"Peter" wrote in message oups.com...
Hi all!

Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.

Any help would be much appreciated.

Peter

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Calling a macro from a closed file

On 10 May, 16:59, "Ron de Bruin" wrote:
You must open the file to run a macro
Why not add the macro in your personal.xls file so you can use it in all your workbooks.
Seehttp://www.rondebruin.nl/personal.htm

Or is there a other reason

--

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



"Peter" wrote in ooglegroups.com...
Hi all!


Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.


Any help would be much appreciated.


Peter- Hide quoted text -


- Show quoted text -


Sorry that won't work as it will be used by a number of people across
a network. I can find the run method in the help. Any other
suggestions?

Thanks,

Peter

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Calling a macro from a closed file

How about creating an addin that you can distribute?
--
HTH...

Jim Thomlinson


"Peter" wrote:

On 10 May, 16:59, "Ron de Bruin" wrote:
You must open the file to run a macro
Why not add the macro in your personal.xls file so you can use it in all your workbooks.
Seehttp://www.rondebruin.nl/personal.htm

Or is there a other reason

--

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



"Peter" wrote in ooglegroups.com...
Hi all!


Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.


Any help would be much appreciated.


Peter- Hide quoted text -


- Show quoted text -


Sorry that won't work as it will be used by a number of people across
a network. I can find the run method in the help. Any other
suggestions?

Thanks,

Peter




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calling a macro from a closed file

Hi

Try Jim's suggestion
See Dave"s example on Debra's site
http://www.contextures.com/xlToolbar02.html

Run you use like this if the workbook is open
Application.Run "template.xls!MyMacroName"


--

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


"Peter" wrote in message oups.com...
On 10 May, 16:59, "Ron de Bruin" wrote:
You must open the file to run a macro
Why not add the macro in your personal.xls file so you can use it in all your workbooks.
Seehttp://www.rondebruin.nl/personal.htm

Or is there a other reason

--

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



"Peter" wrote in ooglegroups.com...
Hi all!


Does anyone know how to call a macro from a closed file and then run
that macro? I have tried recording it but no luck.


Any help would be much appreciated.


Peter- Hide quoted text -


- Show quoted text -


Sorry that won't work as it will be used by a number of people across
a network. I can find the run method in the help. Any other
suggestions?

Thanks,

Peter

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
Run macro when file is opened and closed mcphc Excel Programming 2 February 20th 07 11:32 AM
How to change closed file name - Error: file not found PGM Excel Programming 5 April 18th 06 02:07 PM
Excel is not asking to save a changed file when the file is closed Ron Excel Discussion (Misc queries) 2 March 14th 05 01:05 AM
VBA - on a button event, open another closed file, post changes, close file Fio Excel Programming 0 March 1st 04 01:08 PM


All times are GMT +1. The time now is 08:37 PM.

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"