Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calling another macro?

Hi,


what's the diffrence between these two ways of calling another macro from
within a macro?

Call OtherMacro
Application.Run "OtherMacro"


Thanks,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Calling another macro?

Application.Run would normally be used to call procedures with variables,
that is store the macro name in a variable as you process, or in another
workbook.

If the macro is in the same workbook, Call is far more efficient.

You could even use Call if the macro is in another workbook, if you set a
reference (ToolsReferences) to the other workbook in the calling workbook.

--
__________________________________
HTH

Bob

"Charlotte E." wrote in message
...
Hi,


what's the diffrence between these two ways of calling another macro from
within a macro?

Call OtherMacro
Application.Run "OtherMacro"


Thanks,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calling another macro?

Hmmmm.....


I use 'Application.Run' because it is apparrently the only way to run macros
in imported modules!

Or is it?

Is there any way to run macros in imported modules with 'Call'?


Thanks,


"Bob Phillips" skrev i en meddelelse
...
Application.Run would normally be used to call procedures with variables,
that is store the macro name in a variable as you process, or in another
workbook.

If the macro is in the same workbook, Call is far more efficient.

You could even use Call if the macro is in another workbook, if you set a
reference (ToolsReferences) to the other workbook in the calling
workbook.

--
__________________________________
HTH

Bob

"Charlotte E." wrote in message
...
Hi,


what's the diffrence between these two ways of calling another macro from
within a macro?

Call OtherMacro
Application.Run "OtherMacro"


Thanks,






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Calling another macro?

That would be if you try and call that procedure directly, you would get a
compile error. IF you created a macro in another module that called the
macro that gets imported, and call that from within the importing routine,
no need for Application.Run.

--
__________________________________
HTH

Bob

"Nigel" wrote in message
...
If you have imported a module then it is part of the current workbook and
is callable. If you are running code to import using VBE extensibility
then probably not.

--

Regards,
Nigel




"Charlotte E." wrote in message
...
Hmmmm.....


I use 'Application.Run' because it is apparrently the only way to run
macros in imported modules!

Or is it?

Is there any way to run macros in imported modules with 'Call'?


Thanks,


"Bob Phillips" skrev i en meddelelse
...
Application.Run would normally be used to call procedures with
variables, that is store the macro name in a variable as you process, or
in another workbook.

If the macro is in the same workbook, Call is far more efficient.

You could even use Call if the macro is in another workbook, if you set
a reference (ToolsReferences) to the other workbook in the calling
workbook.

--
__________________________________
HTH

Bob

"Charlotte E." wrote in message
...
Hi,


what's the diffrence between these two ways of calling another macro
from within a macro?

Call OtherMacro
Application.Run "OtherMacro"


Thanks,









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Calling another macro?

Heh, heh - clever way to get around this lack of re-compiling option :-)

But to me it tends to be a little too much calling back and forward - I'll
still stick to 'Application.Run', which gives a more direct approch...

Let's hope that MS will allow re-compiling in future releases...

Thanks for all your answers :-)



"Bob Phillips" skrev i en meddelelse
...
That would be if you try and call that procedure directly, you would get a
compile error. IF you created a macro in another module that called the
macro that gets imported, and call that from within the importing routine,
no need for Application.Run.

--
__________________________________
HTH

Bob

"Nigel" wrote in message
...
If you have imported a module then it is part of the current workbook and
is callable. If you are running code to import using VBE extensibility
then probably not.

--

Regards,
Nigel




"Charlotte E." wrote in message
...
Hmmmm.....


I use 'Application.Run' because it is apparrently the only way to run
macros in imported modules!

Or is it?

Is there any way to run macros in imported modules with 'Call'?


Thanks,


"Bob Phillips" skrev i en meddelelse
...
Application.Run would normally be used to call procedures with
variables, that is store the macro name in a variable as you process,
or in another workbook.

If the macro is in the same workbook, Call is far more efficient.

You could even use Call if the macro is in another workbook, if you set
a reference (ToolsReferences) to the other workbook in the calling
workbook.

--
__________________________________
HTH

Bob

"Charlotte E." wrote in message
...
Hi,


what's the diffrence between these two ways of calling another macro
from within a macro?

Call OtherMacro
Application.Run "OtherMacro"


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
Calling a public Macro from a Private Macro thewizz Excel Programming 6 November 2nd 07 10:23 PM
Calling XLA Macro from DLL. T G Excel Programming 3 November 21st 06 07:37 AM
Calling a macro Otto Moehrbach Excel Programming 6 October 21st 06 10:14 PM
calling next macro Michelle Hanan Excel Programming 1 July 18th 06 06:17 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


All times are GMT +1. The time now is 02:40 PM.

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

About Us

"It's about Microsoft Excel"