When copying the template into your target workbook, you might get an error saying that access to the Visual Basic Project is not trusted. The fix is to enable a setting in the Trust Center or, if your company has locked that setting, to copy the modules over manually.
Option A: Enable the Trust Setting #
- Go to File → Options → Trust Center → Trust Center Settings…
- Click Macro Settings
- Check “Trust access to the VBA project object model”
- Click OK twice
Done! The setting persists, you only need to do this once.
Option B: Manually Copy Modules (If the Setting Is Locked) #
If your company has disabled the option and you can’t tick it, don’t worry, you can copy the modules manually instead.
- Dismiss the error and switch to your target workbook.
- Go to the Developer tab and click Visual Basic to open the Editor.
- If the Developer tab is not visible, right-click the ribbon → Customize the Ribbon → tick Developer → OK.
- In the Project Explorer (left side), you’ll see both the Excel2PPT template and your target workbook.
- Expand the Modules folder under Excel2PPT. Drag each module into your target workbook (click, hold left mouse button, drag and drop). Copy all modules except
mCopyTemplate:LibFileToolsmExportToPPTmRemoveShapesSETTINGS
- Expand the Forms folder under Excel2PPT and drag the
ufSuccessUserForm into your target workbook the same way. - Select your target project, then go to Debug → Compile VBA Project. If you get no errors, you’re good to go.
- Close the VBA Editor, save your workbook, and you can now run the export without any issues.
