How to Run Macro from Another Workbook

How to run a macro from another workbook with VBA. We can access a macro in a different workbook and use it to perform the tasks for which it was written in the new workbook without having to write the same macro again. The syntax of the macro or VBA code is simple and can also be used to access specific ranges in another workbook. Watch the training video below:


Watch this video on YouTube.

Here’s the VBA code:

Sub runMacro()

Run “‘C:\Users\takyar\etv2\protect-unprotect-worksheet.xlsm’!protectworksheet”

End Sub

The above macro code accesses the following macro in another workbook:

Sub protectworksheet()
Sheets(“Sheet1″).Protect Password:=”asdf,,678”
End Sub