Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: "Access is denied" error message when you try to open a form with the ExternalApplication object in InfoPath 2003


View products that this article applies to.

Symptoms

When you use the Open method for the ExternalApplication object in Microsoft Office InfoPath 2003, at run time you receive the following error message:
Error: InfoPath cannot open the following test file: filename.xml. Access is denied.
Code: 80043000
Source: infopath

↑ Back to the top


Cause

This problem occurs because of an InfoPath security check. You receive this error if the form template is stored on a network share instead of on your local computer.

↑ Back to the top


Workaround

To work around this problem, you can use the Microsoft Windows Script Host component (WScript.shell) to open the form programmatically. This workaround is described in more detail in the "More Information" section.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in Microsoft Office InfoPath 2003.

↑ Back to the top


More information

Steps to Reproduce the Problem

  1. Design a new, blank form template in InfoPath.
  2. Save the template as Test.xsn to a network share that you have write access to.
  3. On the File menu, click Fill Out a Form. In the Fill Out a Form task pane, select test.
  4. On the File menu, click Save. Save the form to your local computer as C:\testform.xml.
  5. Quit InfoPath.
  6. Start Notepad, and then copy the following script to a new file that you name Test.js.
    objIP = new ActiveXObject("InfoPath.ExternalApplication")
    //Open an InfoPath form.
    objIP.Open ("C:\\testform.xml")
  7. In Windows Explorer, double-click Test.js to run the script.

    Note You receive the run-time error message that is mentioned in the "Symptoms" section.
To work around this problem, replace the script in Test.js with the following script:
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:\\testform.xml");
Now when you run the script, InfoPath opens Testform.xml without error.

↑ Back to the top


Keywords: KB823436, kbbug

↑ Back to the top

Article Info
Article ID : 823436
Revision : 5
Created on : 7/28/2006
Published on : 7/28/2006
Exists online : False
Views : 294