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 6108917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:20:50+00:00 2026-05-23T14:20:50+00:00

With the Excel addin OfficeExcel2003XMLToolsAddin I’ve been able to define XML mapping for an

  • 0

With the Excel addin OfficeExcel2003XMLToolsAddin I’ve been able to define XML mapping for an Excel Worksheet (this addin converts a range to a XML list) and now I’m able to manually save the Excel file as a XML file, using Save as.

Excel correctly produces something like

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Row>
        <brand>Brand1</brand>
        <Italian>Description1</Italian>
        <English>Description2</English>
    </Row>
    <Row>
        <brand>Brand2</brand>
        <Italian>Description3</Italian>
        <English>Description4</English>
    </Row>
</Root>

Now, I would like to programmatically do the same (hopefully using c#, .NET 4.0).

I tried using npoi and Microsoft Office Interop Excel, using this code

Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
xlApp.Workbooks.OpenXML(@"excelFile.xls");
xlApp.Workbooks[1].SaveAs(xmlFile, XlFileFormat.SOME_FORMAT);

trying with all the enumerations listed on XlFileFormat reference page, with no success.

Any suggestions? Thanks

  • 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-23T14:20:50+00:00Added an answer on May 23, 2026 at 2:20 pm

    This should work

    Application app = new Application();
    app.Workbooks.Open(@"C:\Sample.xlsx",
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                       Type.Missing, Type.Missing);
    string data = string.Empty;
    app.ActiveWorkbook.XmlMaps[1].ExportXml(out data);
    app.Workbooks.Close();
    

    data should contain XML

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

Sidebar

Related Questions

I have an XLL Excel addin and now another team wants to use the
In a VSTO Excel addin the code: Dim XMLDoc As XElement = XElement.Load(XMLFile1.xml) generates
I've created an addin for Excel containing a number of different functions. Now, I
I have a Excel addin that displays some structures on the worksheet. Users can
Good afternoon, I created an Excel .xla addin for Excel 2002. This weird behavior
I am adding an Excel Worksheet object inside Word. Excel has a COM addin
I have a shared COM AddIn (not VSTO) for excel 2003, now I want
This is a very common problem when Excel Worksheet or Chart is embedded into
I'm writing an Excel Addin using COM Interop from .net. I have a command
I have successfully used the Excel and Word addin templates in Visual studio 2008

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.