Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!
Hi,
what do you want to do?
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
Don’t have an account yet? Register yourself now and be a part of our community!