Posted by
Andrian in
VBA Excel on
12 19th, 2009 |
no responses
This tips will give you steps on how to selectively load add-ins in specific worksheet, we’re able to do this on with a little code on macro. Here’s the steps:
- Activate the worksheet in which you want an add-in to be loaded.
- Press the shortcut buttonĀ Alt+F11 to display the VBA Editor or click on Developer ribbon and then click the Visual Basic button on the left hand side.
- Double-click on the “This Workbook” object in the Project Explorer. Excel opens a code window for This Workbook.
- Put the following code into macro windows you have loaded:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
AddIns("Add-In Name").Installed = False
End Sub
Private Sub Workbook_Open()
AddIns("Add-In Name").Installed = True
End Sub
- In the code, change the name of the add-ins (”Add-In Name”) to the real name of the add-in you want to use with the worksheet.
- Close the VBA Editor.
- Save your worksheet.
If you are not sure of the correct name for a particular add-in (see step 5), you can use the macro recorder function to record the process of activating an add-in. That will show you the exact name you should use in the above macros.
Related Post