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

  • Home
  • SEARCH
  • 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 6716629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:45:22+00:00 2026-05-26T08:45:22+00:00

I have a scenario where a client could have either Excel 2007 installed or

  • 0

I have a scenario where a client could have either Excel 2007 installed or Excel 2010 installed, I need to be able to export and import excel files that they create, OLEDB isn’t an option so I was going to use Interop services.

Question is when I coded for 2010 it didn’t work for 2007 and vice versa how can I achieve this?

Can I import both references somehow and define Excel depending on the version installed?

using Excel = Microsoft.Office.Interop.Excel;
Excel.Application xlApp;
            Excel.Workbook xlWorkBook;
            Excel.Worksheet xlWorkSheet;
            Excel.Range xlRange;

            object misValue = System.Reflection.Missing.Value;

            pbarExcelGenerate.Visible = true;

            xlApp = new Excel.Application();
            xlWorkBook = xlApp.Workbooks.Add(misValue);

            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
            xlWorkSheet.Name = "Material Results";

            pbarExcelGenerate.Value = 5;


            xlRange = xlWorkSheet.get_Range("a1", "b1");
            xlRange.Merge(false);
            xlRange.Value = "Material Name";
            xlRange.HorizontalAlignment = 3;
            xlRange.Font.Bold = true;
            xlRange.Font.Size = 16;
  • 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-26T08:45:23+00:00Added an answer on May 26, 2026 at 8:45 am

    no you can’t… you can either use the lower version for both… or use a 3rd-party library (free or commercial) which doesn’t need Excel to be installed at all or you can use raw COM to access Excel which would be much less comfortable but allows for such things.

    EDIT – as per comments (thanks to @Rup):

    You can download the older version of VSTO at http://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=23656 which should come with the Interop library for 2007

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

Sidebar

Related Questions

I have a Client and Server scenario, where a service is installed on the
I need help with a question that I could not answer yet. I have
we have this scenario: A server which contains needed data and client component which
I have the following scenario. The client code only has access to FooHandler, not
Say I have a simple client/server scenario with one method: // client code $client
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario where I need to upload a file from one web
Scenario: I have a partial view that is used in several places across my
Scenario. I have a client with two network connections to a server. One connection
I have one WCF service that exposes two operations - IncrementList() and GetList(). Client

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.