Please help me vba code to run many Macros from another Excel

  • Code
    Please help me vba code to run many Macros from another Excel File. Thank you
  • You can use the Application. Run method in VBA to call macros from another Excel file. Here's an example code snippet that demonstrates how to do this:

    Sub RunMultipleMacros()


    Dim xlApp As Excel.Application

    Dim xlWorkbook As Excel.Workbook


    ' Open the external workbook

    Set xlApp = New Excel.Application

    Set xlWorkbook = xlApp.Workbooks.Open("C:\Path\To\External\File.xlsx")


    ' Call the macros in the external workbook

    xlApp.Run "Macro1"

    xlApp.Run "Macro2"

    xlApp.Run "Macro3"


    ' Close the external workbook

    xlWorkbook.Close SaveChanges:=False

    xlApp.Quit


    Set xlWorkbook = Nothing

    Set xlApp = Nothing


    End Sub


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!