Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7042841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:13:01+00:00 2026-05-28T02:13:01+00:00

I built a application, it generates Excel with COM Interop. It works fine on

  • 0

I built a application, it generates Excel with COM Interop. It works fine on mine and our user’s machine: Office 2007, Windows XP SP2. Now I migrate it to another machine, Office 2010, Windows 7 64 bit, and use visual studio 2010 from VS2008, which still works fine. When I deploy it on my user’s machine, I got the problem, they use the same Windows 7 64 bit but Office 2007.

So if I install Office 2007 PIA on my Win7 64 bit and Office 2010 machine, change the reference in my visual studio project, will that solve the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:13:01+00:00Added an answer on May 28, 2026 at 2:13 am

    I know this post was awhile back, but I figured I’d throw in my two cents anyway in case someone stumbles upon it.

    A general rule of thumb is to use the PIA version in development that links up with the oldest version of Office you plan to support. So, if you’re going to support Office 2007 and up, use version 12 of the PIAs during development.

    Add a reference to v12 PIAs (either by downloading the 2007 PIAs online, via VSTO, or from the GAC if you already had Office 2007 instead previously). Now you might think “Ok, I’m referencing v12 in Visual Studio, this should now work on Office 2007”. Wrong. Since you’re referencing v12 but you have Office 2010 installed, during assembly binding your machine will say “Well, v12 is requested, but we have v14 installed in the GAC and since PIAs are forward compatible, we’ll use that”. Even though you explicitly tell it to use v12, after completion of a build your machine will be using v14. You can confirm this via FUSLOG. FUSLOG is an excellent tool to use when working with assembly binding. Note: If you’re not seeing anything in FUSLOG and you think you should, clear everything in your Internet Explorer history and try again.

    To fix this problem you need to stop what’s called ‘assembly binding redirection‘. These PIAs usually have a policy file with them in the GAC. The purpose of the policy file is to redirect older PIA versions to newer versions when resolving the assembly. To see this, do the following:

    1. Press ‘Windows key + R’ to open the run menu.
    2. Type ‘C:\Windows\Assembly\GAC‘ and press Enter.
      Note: I am running a 32bit machine. Your PIAs will most likely be installed in a different location in the GAC, such as ‘C:\Windows\Assembly\GAC_MSIL’.

    Once in the GAC, scroll down and look for the folders of PIAs you reference (e.g. Microsoft.Office.Interop.Excel). If you continue scrolling, you should see folders that start with ‘Policy’, then a number, then the name of the PIA (e.g. Policy.12.0.Microsoft.Office.Interop.Excel). This is the policy file that performs binding redirection. Open the XML configuration file within that folder and you will see something similar to the following:

    <?xml version="1.0" encoding="UTF-16"?><configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity publicKeyToken="71e9bce111e9429c" name="Microsoft.Office.Interop.Excel" culture="neutral"></assemblyIdentity>
                <bindingRedirect oldVersion="12.0.0.0" newVersion="14.0.0.0"></bindingRedirect>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    

    In the above code snippet, the tag “bindingRedirect oldVersion …” is responsible for the PIA assembly redirection. If you comment out that code like the following:

    <?xml version="1.0" encoding="UTF-16"?><configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity publicKeyToken="71e9bce111e9429c" name="Microsoft.Office.Interop.Excel" culture="neutral"></assemblyIdentity>
                <!--<bindingRedirect oldVersion="11.0.0.0" newVersion="12.0.0.0"></bindingRedirect>-->
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    

    Then this redirection will be ignored. I comment it rather then deleting simply because the file does serve a good purpose, just not when developing for older versions of Office. Perform this on each PIA Policy file that you require, and your development machine will stop redirection.

    Hopefully this answers your question!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I built an application in c# vs2005 .net . Everything works fine when i
I'm using a custom-built inhouse application that generates a standard set of reports on
Consider my windows application built using C# VS 2005 displays certain contents in a
Consider my windows application built using C# VS 2005 displays certain contents in a
let's consider a web application built using MVC concept. If my application generates some
I have built an application that generates a large XML file using Linq-to-Entities and
My application generates XAML files from in-memory objects using the built-in .NET solution: System.XamlServices.Save(Stream,
For an automated setup build that generates the setup for an application which uses
I have a custom built application framework written in PHP which I have been
I have an already built application and I want to add a feature that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.