+ Reply to Thread
Results 1 to 5 of 5

can we call a Sub in another opened vbaproject?

  1. #1
    MVM
    Guest

    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. #2
    Chip Pearson
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Tom Ogilvy
    Guest

    Re: can we call a Sub in another opened vbaproject?

    look in VBA help at the RUN command.

    --
    Regards,
    Tom Ogilvy

    "MVM" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    Bob Phillips
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #5
    MVM
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1