ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   can we call a Sub in another opened vbaproject? (https://www.excelbanter.com/excel-programming/347925-can-we-call-sub-another-opened-vbaproject.html)

MVM

can we call a Sub in another opened vbaproject?
 
I have a workbook. Program copies one sheet and creates another workbook.
this second workbook need to use a Sub in the module of the parent book. Is
it possible? If it is, how?
Thanks
MVM

Tom Ogilvy

can we call a Sub in another opened vbaproject?
 
look in VBA help at the RUN command.

--
Regards,
Tom Ogilvy

"MVM" wrote in message
...
I have a workbook. Program copies one sheet and creates another workbook.
this second workbook need to use a Sub in the module of the parent book.

Is
it possible? If it is, how?
Thanks
MVM




Chip Pearson

can we call a Sub in another opened vbaproject?
 
You can use Application.Run to do this. E.g,

Application.Run "Book1.xls!MacroName"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"MVM" wrote in message
...
I have a workbook. Program copies one sheet and creates another
workbook.
this second workbook need to use a Sub in the module of the
parent book. Is
it possible? If it is, how?
Thanks
MVM




Bob Phillips[_6_]

can we call a Sub in another opened vbaproject?
 
Use Application.Run

Application.Run "'another book2.xls'!test_msgbox"

--

HTH

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


"MVM" wrote in message
...
I have a workbook. Program copies one sheet and creates another workbook.
this second workbook need to use a Sub in the module of the parent book.

Is
it possible? If it is, how?
Thanks
MVM




MVM

can we call a Sub in another opened vbaproject?
 
Tom, Chip, Bob that is a great help. Thank you

"Bob Phillips" wrote:

Use Application.Run

Application.Run "'another book2.xls'!test_msgbox"

--

HTH

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


"MVM" wrote in message
...
I have a workbook. Program copies one sheet and creates another workbook.
this second workbook need to use a Sub in the module of the parent book.

Is
it possible? If it is, how?
Thanks
MVM






All times are GMT +1. The time now is 09:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com