Google Answers Logo
View Question
 
Q: Excel VB - Calling a macro in another workbook ( No Answer,   1 Comment )
Question  
Subject: Excel VB - Calling a macro in another workbook
Category: Computers > Programming
Asked by: les9999-ga
List Price: $10.00
Posted: 31 Dec 2004 11:51 PST
Expires: 03 Jan 2005 15:11 PST
Question ID: 449758
From a macro in a "master" workbook, I would like to load a second
workbook and call a macro in the second workbook. I know how to load
the second workbook but haven't been able to activate the macro.
Example:
' subroutine in master workbook
Sub master()
    Dim wb As Workbook
    Workbooks.Open Filename:="datamast.xls"
    MsgBox "I'm still in control"
    Call datamast.xls!createschooldata ' It will not execute this macro
end sub
Answer  
There is no answer at this time.

Comments  
Subject: Re: Excel VB - Calling a macro in another workbook
From: riyoyo-ga on 02 Jan 2005 22:14 PST
 
You cant execute a macro embedded within anothor work-book. The
simpliest way is just open the second workbook, copy the macro
(do-able from VBA code), and locate on your current workbook, and
execute it. And then remove it once it is unused.

Regards,
Hari

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy