| | Product Information Help and How-to Training Templates Support and Feedback Technical Resources Additional Resources | Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.
Troubleshoot macro security level and warnings
To better understand the security features and warnings, and for step-by-step information on preventing the security warnings from appearing each time you open a file, see Frequently asked questions about Access security warnings. Restricted Access I can't change the macro security level
Your network administrator might have enforced a security level for your workgroup or corporation to ensure that you use only macros that have been determined to be virus-free. For more information, see your network administrator.
The Trust access to Visual Basic Project setting in the Security dialog box is unavailable The Trust access to Visual Basic Project setting is not available in Access. You cannot block programmatic access to the Visual Basic Project.Macro Warnings I'm told that my database can't be opened because Access security settings restrict access to the file
You may receive this message for one of the following reasons: I don't want to be warned about any macros
The only way to avoid macro warnings when you open a database in medium or high security is by ensuring that the database has a valid digital signature, and then adding that signature to your list of trusted sources.
If the macros are already signed and if you are willing to trust all macros signed with that certificate, add the signer to your list of trusted sources. This will stop macro warnings when your Security setting is set to High or Medium. Note The presence of a certificate does not guarantee that a macro is safe. Always review the details of the certificate—for example, look at the Issued to and Issued by fields to determine whether you trust its publisher, and look at the Valid from field to determine if the certificate is current.
A less secure option is to change the security level to Low. When your macro security level is set to Low, Microsoft Access will not provide warnings about macros. To reduce your risk of getting a macro virus infection on your computer, run specialized antivirus software that is up to date and that can check files and add-ins for macro viruses, and use macros only from trusted sources.
I keep getting a warning about macros
- The database might not be from a trusted source If the security level is set to Medium or High, and you open a database that contains digitally signed macros that are not from a trusted source, you receive a security warning. If you are sure you trust the macro developer, add the name to the list of trusted publishers on the Trusted Publishers tab in the Security dialog box (on the Tools menu, point to Macro, and click Security). If you do not see the Macro menu item under the Tools menu, or the Security menu item under the Macro menu, click the arrows at the bottom of a drop-down menu to display the hidden menu items.
Tip If you want to see all menu items by default, on the Tools menu, click Customize, click the Options tab, and select the Always show full menus check box. I still can't see the Security command under the Macro menu
- On the Tools menu, click Customize, and then click the Commands tab.
- Click Rearrange Commands, select Menu Bar, and in the Menu Bar box, click Tools | Macro.
-
In the Controls section, click Add.
The Add command dialog box will appear. - In the Categories box, click Tools, and then in the Commands box, click Security.
The Security command will appear in the Controls box. - Use the Move Up and Move Down buttons to position the Security command where you want.
If you'd like to position the Security command in its own group (between horizontal lines), with Security selected, click Modify Selection and click Begin a Group. Select the menu item below the Security command, and repeat. - Click Close twice.
- The database might contain a macro virus If you don't expect the database to contain a macro (macro: An action or set of actions that you can use to automate tasks.), Visual Basic for Applications (VBA) code, a form (form: An Access database object on which you place controls for taking actions or for entering, displaying, and editing data in fields.) that contains an ActiveX control (ActiveX control: A control, such as a check box or button that offers options to users or runs macros or scripts that automate a task. You can write macros for the control in Microsoft Visual Basic for Applications or scripts in Microsoft Script Editor.), a report (report: An Access database object that prints information that is formatted and organized according to your specifications. Examples of reports are sales summaries, phone lists, and mailing labels.) that contains an ActiveX control, action query (action query: A query that copies or changes data. Action queries include append, delete, make-table, and update queries. They are identified by an exclamation point (!) next to their names in the Database window.), data-definition query (data-definition query: An SQL-specific query that contains data definition language (DDL) statements. These statements allow you to create or alter objects in the database.), pass-through query (pass-through query: An SQL-specific query you use to send commands directly to an ODBC database server. By using pass-through queries, you work directly with the tables on the server instead of having the Microsoft Jet database engine process the data.), or update query (update query: An action query (SQL statement) that changes a set of records according to criteria (search conditions) that you specify.) you might have a virus that is adding a macro virus to the database. Check your computer for viruses, and try to get an uninfected copy of the database from the source.
- The macro might be in a temporary file that you
downloaded from a Web site If your virus scanner tells you that it
has removed a virus in this file every time you open it, you are removing the
virus from the temporary file only and not from the original file on the Web
server. Check your computer for viruses and then notify the publisher about
problems with the original file.
- The database is a replica Often, replicas lose the signature during synchronization. Check with the publisher of the database.
- The database does not allow Access to read the definition of tables and queries If the publisher of the database has revoked the right to read table and query definitions, Access will not be able to verify whether the database is safe. In such a situation, the database will treated as an unsigned database.
- The database is opened from Microsoft Visual Source Safe If you are using Visual Source safe to manage files, then attempting to open a signed database from Visual Source Safe will display warnings. This is because Visual Source Safe disables digital signatures and the database is treated like an unsigned database.
- The database contains legitimate macros If you know these are legitimate and safe, you might want to digitally sign the database and then add your name to the list of trusted publishers on the Trusted Publishers tab in the Security dialog box (on the Tools menu, point to Macro, and click Security). If you do not see the Macro menu item under the Tools menu, or the Security menu item under the Macro menu, click the arrows at the bottom of a drop-down menu to display the hidden menu items.
Tip If you want to see all menu items by default, on the Tools menu, click Customize, click the Options tab, and select the Always show full menus check box. I still can't see the Security command under the Macro menu
- On the Tools menu, click Customize, and then click the Commands tab.
- Click Rearrange Commands, select Menu Bar, and in the Menu Bar box, click Tools | Macro.
-
In the Controls section, click Add.
The Add command dialog box will appear. - In the Categories box, click Tools, and then in the Commands box, click Security.
The Security command will appear in the Controls box. - Use the Move Up and Move Down buttons to position the Security command where you want.
If you'd like to position the Security command in its own group (between horizontal lines), with Security selected, click Modify Selection and click Begin a Group. Select the menu item below the Security command, and repeat. - Click Close twice.
Important The only way to avoid macro warnings when you open a database in medium or high security is by ensuring that the database has a valid digital signature, and then adding that signature to your list of trusted sources.
I get a warning about my database not matching the digital signature Under medium or high security, Access will not open a database if it does not match the signature. A database might not match its signature due to one of the following reasons:- Database has been modified by a virus or a malicious hacker.
If you are concerned that the database might have been modified by a virus or a malicious hacker, you should not attempt to open the database. Instead, restore a backup copy of the database.
- Database has been modified programmatically If you use DAO to create or modify an action query, or any part of the database that is included in the digital signature, then you need to manually re-sign the database.
Manually re-sign the database - On the Tools menu, point to Macros, and click Security. If you do not see the Macro menu item under the Tools menu, or the Security menu item under the Macro menu, click the arrows at the bottom of a drop-down menu to display the hidden menu items.
Tip If you want to see all menu items by default, on the Tools menu, click Customize, click the Options tab, and select the Always show full menus check box. I still can't see the Security command under the Macro menu
- On the Tools menu, click Customize, and then click the Commands tab.
- Click Rearrange Commands, select Menu Bar, and in the Menu Bar box, click Tools | Macro.
-
In the Controls section, click Add.
The Add command dialog box will appear. - In the Categories box, click Tools, and then in the Commands box, click Security.
The Security command will appear in the Controls box. - Use the Move Up and Move Down buttons to position the Security command where you want.
If you'd like to position the Security command in its own group (between horizontal lines), with Security selected, click Modify Selection and click Begin a Group. Select the menu item below the Security command, and repeat. - Click Close twice.
- In the Security dialog box, select Low.
Warning If there is any possibility of the database having been modified by a virus or a malicious hacker, you should not attempt to open the database. Instead, you should restore a backup copy of the database. - Open the database.
- Remove the signature. For more information on how to remove a signature, see the Help topic Remove a digital signature.
- Add the signature to the database. For more information on how to add a signature, see the Help topic Add a digital signature to a VBA project.
- Close the database.
- In the Security dialog box, select Medium or High.
To avoid modifying a database programmatically, try one of the following: - Database has been modified by a previous version of Access
When a database is signed, previous versions of Access cannot modify VBA code. However, a user can modify macros, action queries, and ActiveX controls on forms and reports using a previous version of Access.
To solve this problem, you need to manually re-sign the database. For more information on how to do this, see the section Data has been modified programmatically in this topic. - Access closed before it could re-sign the database This could happen in two situations:
- An error occurred that prevented Access from re-signing the database before closing.
- You changed ActiveX control properties, switched to browse view without saving changes, and attempted to close Access. In this situation, even if you click Yes when prompted to save changes, Access will not re-sign the database.
To solve this problem, you need to manually re-sign the database. For more information on how to do this, see the section "Data has been modified programmatically," in this topic.
- A form or report in the database that contains an ActiveX control was exported to XML or ASP format When a form or report is exported to either XML or ASP format, the form or report is opened in design view, exported, and then saved. The form or report is saved, even though no changes were made to it. If the form or report contains an ActiveX control, Access will attempt to re-sign the database. If the certificate that was used to sign the database is not installed, Access will remove the signature from the database, display a message, and leave the database in unsigned state.
Since ActiveX controls are ignored when exporting to XML or ASP format, the recommended workaround is to create a form or report similar to the one that you want to export, but without the ActiveX control, and export the new object.
Note Exporting to other file formats does not cause this problem. I get a warning each time I open a file that is in Access 97 or earlier format You can add signatures to a file in Access 2000 or later file format. Files in Access 97 or earlier file formats will cause Access to display the security warning each time you open a file. The security warning interrupts the execution of automation scripts Each time you open an unsigned database under medium or high security, you will be prompted with a security warning. This can cause problems when you are using automation to open a database in a process that is not being monitored by a user, because the security warning requires user interaction. You can use the AutomationSecurity property to suppress the warning from occurring when opening a database using automation. The following is an example of a Visual Basic script that uses the AutomationSecurity property to suppress the security warning when opening a database.
Caution This technique should be used only if the database is in a location that cannot be modified by a virus or any unauthorized person. Opening databases that are on public network locations or shared directories on the local machine could be dangerous.
Const cDatabaseToOpen = "C:\<FileToOpen>.mdb"
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If Val(AcApp.Version) >= 11 Then
AcApp.AutomationSecurity = 1 ' msoAutomationSecurityLow
End If
AcApp.Visible = True
AcApp.OpenCurrentDatabase cDatabaseToOpen
If AcApp.CurrentProject.FullName <> "" Then
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen & "'."
End If
Simply double-click the VBS file to open your database.
|