Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default How to call a sub from different file

Sorry for this basic question, I just can't seem to find
the answer in 'Help' ... imagine that!

I have a macro that takes over an hour to run. We'd like
to have a scheduler PC run this early in the morning.
Being on a scheduler, the macro cannot have any user
input. Also, I don't want to make it an autoexec macro
because the user might want to go into the file during the
day and NOT want the macro to run.

I'm thinking of having the scheduler PC execute a macro in
a different file that runs the big macro. But I'm having
trouble simply calling the macro from a different file.
Isn't it possible to run a macro in a different file?

Example: File1 contains Sub Test1() and File2 contains Sub
Test2(). Can't Test1 call Test2????

Thank You!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to call a sub from different file

Norm,

Yes it can, you just use application.run for example

Application.Run "file2.xls!test2"


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Norm" wrote in message
...
Sorry for this basic question, I just can't seem to find
the answer in 'Help' ... imagine that!

I have a macro that takes over an hour to run. We'd like
to have a scheduler PC run this early in the morning.
Being on a scheduler, the macro cannot have any user
input. Also, I don't want to make it an autoexec macro
because the user might want to go into the file during the
day and NOT want the macro to run.

I'm thinking of having the scheduler PC execute a macro in
a different file that runs the big macro. But I'm having
trouble simply calling the macro from a different file.
Isn't it possible to run a macro in a different file?

Example: File1 contains Sub Test1() and File2 contains Sub
Test2(). Can't Test1 call Test2????

Thank You!



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
how to call a reference to a cell in external file jose Excel Worksheet Functions 2 February 27th 07 09:59 AM
Call a batch file from an Excel Macro Alex Horan Excel Discussion (Misc queries) 0 March 2nd 06 03:29 PM
VBA to call file based on date fLiPMoD£ Excel Discussion (Misc queries) 2 April 23rd 05 09:24 PM
Call macros from another XL file jamesa Excel Programming 2 October 2nd 03 05:51 PM
Subroutine call without file reference jaf Excel Programming 0 August 25th 03 05:52 PM


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