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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:12:35+00:00 2026-06-10T04:12:35+00:00

Excel can save its Workbooks in the XML Table format preserving all the formatting

  • 0

Excel can save its Workbooks in the “XML Table” format preserving all the formatting and styling information and then open and edit them as native Excel workbooks. I wish to generate such files by Mathematica for Excel programmatically adding formatting information for rows, columns, cells etc.

The first stumbling problem is that even when I Import Excel-generated file in Mathematica and then just Export it backward to "XML" the resulting file cannot be opened by Excel. Opening it in a text editor shows that this file contains apostrophes instead of quotes. Adding the "AttributeQuoting" -> "\"" option to Export fixes this but the resulting file still cannot be opened by Excel. More careful comparison shows that Export also drops the most of namespace prefixes in the generated file.

How to generate Excel-compatible XML files from Mathematica?

P.S. This question comes from the previous question: “How to export to Excel numbers as text fields from Mathematica?“

  • 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-06-10T04:12:37+00:00Added an answer on June 10, 2026 at 4:12 am

    I have found the solution. From the Documentation,

    Some documents use names in a non-namespace-compliant fashion, because
    the XML namespace recommendation, which extends XML, was made after
    the initial XML recommendation. "IncludeNamespaces"->"Unparsed" is
    provided to allow parsing of these documents. The name is always
    represented as the exact single string that appears in the XML file.
    Unless absolutely necessary, this option value should not be used.

    With the option "IncludeNamespaces"->"Unparsed" everything is nice and even the "AttributeQuoting" -> "\"" option is not needed:

    XMLData = Import["test.xml", "IncludeNamespaces" -> "Unparsed"];
    Export["test-from MMa.xml", XMLData]
    

    The exported file is opened by Excel without warnings.

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

Sidebar

Related Questions

im trying to format an XML-file so that its possible to open it directly
How can I save data from an Excel sheet to .RData file in R?
I can't open an Excel spread sheet with .NET on an x64 server using
How can I convert an Excel date (in a number format) to a proper
I have an application where you can open many different items (like in excel
I encountered a problem that I can't manage to save Excel start time and
i have a VSTO application(WPF) which can save an opened Excel File on a
In an Excel formula you can use =ISERR(A1) or =ISERROR(A1) In a VBA macro
I want to know if PHPExcel can: Create Excel spreadsheets with embeded image. The
Using Application.OnKey <key>, <procedure> , I can cause Excel to run <procedure> whenever <key>

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.