Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A simple question


Hi,

I have two workbooks, "A" and "B", and both are open and contain
macros/functions. How do I call (execute), from "A", a macro in "B"?
Is that possible?

Thanks in advance for any help!

---Fausto




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default A simple question

Try

Sub Test()
Application.Run "B!Module1.Test"
End Sub

where you've defined a function called Test in Module1 of worksheet B.

HTH

"Fausto Arinos Barbuto" wrote:


Hi,

I have two workbooks, "A" and "B", and both are open and contain
macros/functions. How do I call (execute), from "A", a macro in "B"?
Is that possible?

Thanks in advance for any help!

---Fausto





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default A simple question

Application.Run "'B.xls'!myMacro"

--

HTH

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


"Fausto Arinos Barbuto" wrote in message
...

Hi,

I have two workbooks, "A" and "B", and both are open and contain
macros/functions. How do I call (execute), from "A", a macro in "B"?
Is that possible?

Thanks in advance for any help!

---Fausto






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A simple question


Worked 100% well! Thanks so much, Bob!

---Fausto


"Bob Phillips" wrote in message
...
Application.Run "'B.xls'!myMacro"

--

HTH

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default A simple question

Like this:
Application.Run "PERSONAL.XLS!Cleanup"

*******************
~Anne Troy

www.OfficeArticles.com


"Fausto Arinos Barbuto" wrote in message
...

Hi,

I have two workbooks, "A" and "B", and both are open and contain
macros/functions. How do I call (execute), from "A", a macro in "B"?
Is that possible?

Thanks in advance for any help!

---Fausto








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A simple question


"Bob Phillips" wrote in message


Application.Run "'B.xls'!myMacro"


A brief observation though: the '' around B.xls seem to be
unnecessary, as

Application.Run "B.xls!myMacro"

works fine.

---Fausto




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A simple question


"Anne Troy" wrote in message

Like this:
Application.Run "PERSONAL.XLS!Cleanup"


Thanks, Anne. And if I want to be really picky, I might even call
a function/sub like this:

Application.Run "Consequences.xls!Flow.CalculatePressureDrop"

where "Flow" is the name of the module where the function/sub
"CalculatePressureDrop" resides.

Now I can integrate my workbooks properly. :-)

---Fausto



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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
simple VBA question abxy[_55_] Excel Programming 2 April 16th 04 12:35 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM
Simple Question JS[_4_] Excel Programming 1 July 10th 03 06:19 AM


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