Access Denied or Permission Denied when calling the IApplication::OpenDocument method from a modal dialog box

Last Published: April 25, 2020

Error Message

Attempting to call the IApplication::OpenDocument method from within a modal dialog box generates a permissions error.

When programming in VB6, the error message "Permission Denied" may occur with an error number of 70.

When programming in Visual Studio .NET, an exception of type System.UnauthorizedAccessError may occur and return "Access Denied".


OpenDocument and NewDocument cannot be called when there is a modal dialog box present in the application. This is prevented by the internal design of ArcGIS.

Solution or Workaround

  • Close the dialog box before calling the OpenDocument method. This approach is often used by core ESRI modal dialog boxes, such as the Open Document dialog box.
  • If you require your dialog box to stay open across the transition between documents then the dialog box should be displayed in a modeless manner.

Article ID:000007754

  • ArcMap 9 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options