Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MVM MVM is offline
external usenet poster
 
Posts: 53
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
MVM MVM is offline
external usenet poster
 
Posts: 53
Default 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




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
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
stop excel file opened as read only if already opened by another u bobm Excel Programming 3 August 5th 05 04:11 PM
Event to call before a opened workbook is recalculated Torben Laursen[_2_] Excel Programming 4 December 16th 04 05:32 PM
Opening a workbook if not opened, going to it if already opened neotokyo[_3_] Excel Programming 0 September 24th 04 08:56 PM
How to see if the opened workbook is opened by another user ? balexis Excel Programming 1 August 18th 04 04:11 PM


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