Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 8
Default How to call up a macro in a different location?

When I am running a macro "ABC" located in Personal.xls, how can I
call up a macro "XYZ" located in another open workbook,
MyWorkBook.xls? Thanks for your help.

TIA
Tom

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to call up a macro in a different location?

Dim wkbk as workbook
dim macroname as string
set wkbk workbooks("myworkbook.xls") 'it has to be open
macroname = "xyz"
application.run "'" & wkbk.name & "'!" & macroname

==
or just
application.run "myworkbook.xls!xyz"
or
application.run "'my workbook.xls'!xyz"
(if your workbook name has spaces)


Tom wrote:

When I am running a macro "ABC" located in Personal.xls, how can I
call up a macro "XYZ" located in another open workbook,
MyWorkBook.xls? Thanks for your help.

TIA
Tom


--

Dave Peterson
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
Excel: Use pic location string to call up picuture in cell? vloh28 Excel Discussion (Misc queries) 1 October 30th 07 12:42 AM
Asynchronous call (macro) Rodrigo Ferreira Excel Discussion (Misc queries) 1 August 29th 07 07:41 PM
macro call Steve Excel Discussion (Misc queries) 12 August 25th 06 04:27 AM
How Can I call any form or macro.. Victor Excel Worksheet Functions 1 November 16th 05 08:42 AM
How to call a macro in an XLA add-in Peter Laman Excel Discussion (Misc queries) 1 March 10th 05 05:40 PM


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