Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.To resolve this problem, use one of the following methods.
Method 1
For the computer on which you are trying to use VBA, you should be logged on as a user who is a member of the Administrators local group or of the Power Users local group. You may be able to edit the registry on the computer to enable VBA access to other users. However, the recommended solution is to include the users in at least one of the two local groups. The suggested modifications to enable VBA access to other users are as follows.
Note In this procedure, you will modify the following registry keys:
- HKEY_CLASSES_ROOT\Clsid
- HKEY_CLASSES_ROOT\Typelib
- HKEY_CLASSES_ROOT\Interface
- HKEY_LOCAL_MACHINE\Software\Classes\CLSID
To grant permissions to the registry keys, follow these steps:
- Log on as an administrator.
- Start Registry Editor. To do this, click Start, click Run, type regedt32.exe, and then click OK.
- Locate the following registry key:
HKEY_CLASSES_ROOT\Clsid
- On the Security menu, click Permissions.
Note The Registry Key Permissions window appears. - Click Add, add the users or the groups, and then click to select the Full Control check box to specify the type of access.
- Click OK to close the Registry Key Permissions window.
- Repeat steps 3 through 6 for the remaining registry keys.
- Exit Registry Editor.
Note When you exit Registry Editor, the other users for whom you changed permissions can register type libraries, Component Object Model (COM) objects, and other objects.
Method 2
Note The following steps have not been extensively tested. We were able to successfully run Microsoft Dynamics GP with VBA as a non-administrative user. As of Microsoft Dynamics GP 9.0 Service Pack 1 (SP1), you can have VBA function for all users without exposing any registry keys.
To have VBA function for all users without exposing any registry keys, follow these steps:
- Log on as an administrator.
- Start Microsoft Dynamics GP, start VBA Editor, and then exit Microsoft Dynamics GP.
- Search for the Controls.exd file that is located in the following location:
\Documents and Settings\username\Local Settings\Temp\Dynamics9.0
Copy this file to a location that all users can access. For example, copy the file to the following location:\Documents and Settings\All Users\DynamicsVBA
- Click Start, click Run, type the following, and then click OK:
regtlib.exe "C:\Documents and Settings\All Users\DynamicsVBA\Controls.exd
- Repeat steps 3 and 4 by using the RptControls.exd file.
Note This file will only exist if the VBA file contains report modifications. - Search for the MSForms.exd file in the following location:
\Documents and Settings\username\Local Settings\Temp\VBE
If this file exists, repeat step 4 by using the RptControls.exd file.
Note This file will only exist if the VBA file contains a user form.
At this point, non-administrative users should be able to run the VBA code without granting access to any registry keys. However, you may first have to delete the Controls.exd file, the RptControls.exd file, and the MSForms.exd file.
Note These steps must be repeated every time that the VBA project is changed whether it is by using VBA Editor, by using an imported package file, or by putting a different VBA file into the code folder.