You may receive an run-time error when you programmatically allow access to a Visual Basic project in Excel 2003 (813969)



The information in this article applies to:

  • Microsoft Office Excel 2003

SYMPTOMS

When you run code that uses the Microsoft Visual Basic for Applications Extensibility 5.3 Library, you may receive the following error message:
Run-time error '1004': Programmatic access to the Visual Basic Project is not trusted
For a Microsoft Excel 2002 version of this article, see 282033.

CAUSE

Microsoft Excel 2003 contains a security feature that allows you to choose whether programmatic access to the Visual Basic project is trusted.

The default setting is to not trust programmatic access to the Visual Basic project.

RESOLUTION

To allow programmatic access to the Visual Basic project, follow these steps:
  1. On the Tools menu, point to Macro, and then click Security.
  2. In the Security dialog box, click the Trusted Sources tab.
  3. Select the Trust access to Visual Basic Project check box.
  4. Click OK.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbProgramming kberrmsg kbprb KB813969