+ Reply to Thread
Results 1 to 2 of 2

Reference code in another workbook from a calling workbook

  1. #1
    Datasort
    Guest

    Reference code in another workbook from a calling workbook

    Is there a way to reference or call code from one workbook to another?

    Example

    Workbook1 had a module called Mod1 and a sub called Sub1
    Workbook2 had a module called Mod2 and a sub called Sub2


    Can sub1 call sub2

    Sub CallAcrossWorkbooks()
    Call workbooks(“Book2�).modules(“Mod2�).Procedure(“Sub2�)

    End Sub

    Thanks in advance,

    Stewart

  2. #2
    Dave Peterson
    Guest

    Re: Reference code in another workbook from a calling workbook

    If both workbooks are open:

    application.run "book2.xls!mod2.sub2"



    Datasort wrote:
    >
    > Is there a way to reference or call code from one workbook to another?
    >
    > Example
    >
    > Workbook1 had a module called Mod1 and a sub called Sub1
    > Workbook2 had a module called Mod2 and a sub called Sub2
    >
    > Can sub1 call sub2
    >
    > Sub CallAcrossWorkbooks()
    > Call workbooks(“Book2�).modules(“Mod2�).Procedure(“Sub2�)
    >
    > End Sub
    >
    > Thanks in advance,
    >
    > Stewart


    --

    Dave Peterson

+ 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