+ Reply to Thread
Results 1 to 4 of 4

How do I run a Sub Procedure that's in another open Workbook?

Hybrid View

charley3 How do I run a Sub Procedure... 06-22-2015, 10:32 PM
quekbc Re: How do I run a Sub... 06-22-2015, 10:41 PM
charley3 Re: How do I run a Sub... 06-22-2015, 11:38 PM
quekbc Re: How do I run a Sub... 06-23-2015, 12:01 AM
  1. #1
    Registered User
    Join Date
    06-22-2015
    Location
    Longview WA
    MS-Off Ver
    MS Office 2000
    Posts
    6

    How do I run a Sub Procedure that's in another open Workbook?

    I have two workbooks open at the same time, one is the ActiveWorkbook, the other is an inactive workbook.

    The ActiveWorkbook's name is always "BatchImport" with filename of "BatchImport.xls".

    The inactive workbook's name is always "New Med Sheets1" with filename of "New Med Sheets1.xls".


    Both workbooks have Option Private Module at the top of the module they're in.

    In the ActiveWorkbook, I have a Sub Procedure that needs to run/call/trigger a Sub Procedure in the inactiveworkbook.

    I've never done that before, and I can't find it in my books or VBE help or Object Browser. So some online expert advice would be greatly appreciated.

    Thank you
    Last edited by charley3; 06-22-2015 at 10:48 PM.

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How do I run a Sub Procedure that's in another open Workbook?

    This link here might help you with what you are looking for (i.e. use Application.Run)

    http://www.rondebruin.nl/win/s9/win001.htm

  3. #3
    Registered User
    Join Date
    06-22-2015
    Location
    Longview WA
    MS-Off Ver
    MS Office 2000
    Posts
    6

    Re: How do I run a Sub Procedure that's in another open Workbook?

    Thanks quekbc! Your info/link worked great.

    My code is now:

    Application.Run "'New Med Sheets1'!Import_Data_ALL_sheets"

    It now works well and does exactly what I need. It runs the Import_Data_ALL_sheets Sub Procedure in the other workbook.

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How do I run a Sub Procedure that's in another open Workbook?

    That's good to hear charley3. Can you also mark this thread as SOLVED?

    Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to open a closed workbook and select copy cells into an open workbook
    By helloganesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 02:00 PM
  2. Workbook.Open Filename procedure
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-16-2010, 10:30 PM
  3. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM
  4. [SOLVED] Correct Procedure to Open Help File?
    By JK in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2006, 01:35 AM
  5. [SOLVED] Auto-Open procedure
    By patrick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2005, 06:15 PM

Tags for this Thread

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