Welcome to MSDN Blogs Sign in | Join | Help

InfoPath cannot open the selected form because of an error in the form's code

Today while trying to open an InfoPath 2007 form I got the following error:

Form template: http://MyServerName/forms/form.xsn
InfoPath cannot open the selected form because of an error in the form's code.
The Microsoft .NET Framework 1.1 is not installed on your computer or the InfoPath primary interop assembly (PIA) is not registered. Use Add or Remove Programs in Control Panel to make sure that Microsoft .NET Framework 1.1 is installed or install it using Windows Update, then run Setup again to confirm that .NET Programmability Support is installed, or contact your system administrator.
Index refers beyond end of list.


I did not have Office 2007 PIAs (Primary Interop Assemblies) on my machine, but .NET Fx 1.1 was already there.

Anyhow, you can download Microsoft Office PIAs from the following links:

Microsoft Office XP
http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en

Microsoft Office 2003
http://www.microsoft.com/downloads/details.aspx?familyid=3C9A983A-AC14-4125-8BA0-D36D67E0F4AD&displaylang=en

Microsoft Office 2007
http://www.microsoft.com/downloads/details.aspx?familyId=59daebaa-bed4-4282-a28c-b864d8bfa513&displayLang=en

After installing Office PIAs, check that InfoPath has been installed with ".NET programmability support" selected. When you install the .NET Framework after having installed Microsoft Office this option does not get installed/configured.

Published Friday, June 08, 2007 6:29 PM by mapo

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: InfoPath cannot open the selected form because of an error in the form's code

Tuesday, July 07, 2009 8:04 PM by ted spawn

Go into add\remove programs and install all elements for Office 2007.

this will resolve the infopath problem

# re: InfoPath cannot open the selected form because of an error in the form's code

Wednesday, September 16, 2009 3:15 PM by john c

The form I created did not have codes at all. So what I did was since it didn't allow me to open by double clicking the file or from InfoPath itself I right click the click on Design. After it opened I did REMOVE CODE from  Tools | Form Options | Programming | REMOVE CODE in the Form template code language.

# re: InfoPath cannot open the selected form because of an error in the form's code

Thursday, October 08, 2009 11:49 AM by Marie L

Thanks, Jon C! Your version fixed the problem with my design...

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker