+ Reply to Thread
Results 1 to 3 of 3

Calling macro from another workbook

  1. #1
    Forum Contributor
    Join Date
    12-02-2013
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    112

    Calling macro from another workbook

    Hi,

    There is a workbook at C:\RENTS\FINAL ANSWER.xlsm from where couple of macros needs to run.

    Those two macros are at C:\RENTS\FINAL.xlsm and S:\RENTS\FINAL.xlsm
    Name of first macro at (C:\RENTS\FINAL.xlsm) is MACRO1 and the name of second macro at (S:\RENTS\FINAL.xlsm) is MACRO2

    Whats the code that runs those two macros simultaneously?

    Any ideas will be well appreciated.
    Thank you
    Last edited by LAVA2; 02-10-2018 at 06:50 AM. Reason: extending

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Calling macro from another workbook

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    12-02-2013
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: Calling macro from another workbook

    Hi, AlphaFrog thanks for the code, but after running MACRO1 it just stops there instead of running MACRO2.
    pls guide
    thanks

    this is the code i have so far:

    PHP Code: 
    Private Sub CommandButton1_Click()

    Application.Run "'C:\RENTS\FINAL.xlsm'!MACRO1"
    Application.Run "'S:\RENTS\FINAL.xlsm'!MACRO2"
     
    ActiveWorkbook.Save
    ActiveWorkbook
    .Close

    End Sub

    Private Sub CommandButton2_Click()


    Application.Run "'C:\RENTS\FINAL.xlsm'!MACRO1"
    Application.Run "'S:\RENTS\FINAL.xlsm'!MACRO2"
     
    ActiveWorkbook.Save

    Application
    .DisplayAlerts False
        Application
    .Quit
         
    '//shut down the computer
        Shell "shutdown -s -t 02", vbHide


    End Sub 
    Last edited by LAVA2; 02-10-2018 at 02:16 PM. Reason: clearify

+ 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. [SOLVED] Calling macro from another workbook
    By garveyarmy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2017, 07:19 AM
  2. Manipulating ActiveWorkbook when calling macro from Personal Macro Workbook
    By 146considerations in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-05-2017, 12:16 AM
  3. Error when calling a 'sheet macro' inside a workbook wide macro
    By Rhino_dance in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-09-2016, 03:46 PM
  4. Calling a macro in a protected workbook
    By GJChurchward in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2015, 07:18 AM
  5. Calling a Macro From a diffrent workbook
    By tzahi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-20-2011, 03:27 AM
  6. Calling macro in another workbook
    By scabral in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2009, 02:03 PM
  7. Calling Macro From Different Workbook
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-23-2008, 07:03 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