Questions tagged [openxml]

Questions regarding reading and writing of Microsoft Office Open XML files either through direct manipulation of the XML files contained in a zip package or through the Microsoft Office Open XML SDK.

Office Open XML File Formats Official Standard

http://www.ecma-international.org/publications/standards/Ecma-376.htm

Microsoft Office Open XML SDK 2.0

http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en

3743 questions
14
votes
4 answers

Set xlsx to recalculate formulae on open

I am generating xlsx files and would like to not have to compute the values of all formulae during this process. That is, I would like to set to 0 (or omit it) for cells with an , and have Excel fill in the values when it is opened. One…
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
14
votes
1 answer

Shared Strings in Excel 2010

Can someone help me in understanding the Shared Strings in MS Excel? I tried to understand using some blogs but could not get complete idea. Everyone is explaining how to access Shared String using Open XML and where the Shared Strings stored (as…
Santhosh
  • 1,357
  • 4
  • 15
  • 30
13
votes
4 answers

Reading .Doc File using DocumentFormat.OpenXml dll

When I am trying to read .doc file using DocumentFormat.OpenXml dll its giving error as "File contains corrupted data." This dll is reading .docx file properly. Can DocumentFormat.OpenXml dll help in reading .doc file? string path =…
Shardaprasad Soni
  • 541
  • 2
  • 6
  • 10
13
votes
4 answers

Excel and "unreadable content" when creating an Open XML spreadsheet with MemoryStream

When creating an Excel spreadsheet using the Open XML SDK v2.0, our Excel output initially worked successfully for a number of months. Recently Excel (all versions) began to complain about "Excel found unreadable content in 'zot.xlsx'. Do you want…
energyiq
  • 141
  • 1
  • 5
13
votes
2 answers

Invalid Hyperlink: Malformed URI is embedded as a hyperlink in the document

I'm using the OpenXml namespace in my application. I'm using this to read the XML within an Excel file. This works fine with certain excel files but on others I get a run time error saying Invalid Hyperlink: Malformed URI is embedded as a…
Craig Gallagher
  • 1,613
  • 6
  • 23
  • 52
13
votes
1 answer

How to count rows per worksheet in OpenXML

I switched from Interop library to OpenXML, because I need to read large Excel files. Before that I could use: worksheet.UsedRange.Rows.Count to get the number of rows with data on the worksheet. I used this information to make a progressbar. In…
Jacobian
  • 10,122
  • 29
  • 128
  • 221
13
votes
1 answer

How to insert a shape in a powerpoint slide using OpenXML

This question could seem rather basic, but how do I insert a shape (i. e. a rectangle) in a slide using OpenXML in c#? I've searched around and all I see is "create a slide with the shape and use the SDK Productivity Tool to reflect the code. That's…
Yván Ecarri
  • 1,661
  • 18
  • 39
13
votes
4 answers

Change font color in OpenXML word document (C#)

I've been searching for hours and I just can't seem to find a solid answer for this. I have an existing document with content controls that I need to edit the text in with external data. If the data for one of the controls is not present, then I…
Rein
  • 215
  • 1
  • 2
  • 12
13
votes
3 answers

How to read the xls and xlsx files using c#

How to read the xls and xlsx files using c# with OpenXML format Without using the OLEDB connection. I am looking for Open XML format procedure. Below is the code in which I used the OLEDB preocedure. But I am looking for OpenXML format. public…
user1537319
13
votes
5 answers

Saving an OpenXML Document (Word) generated from a template

I have a bit of code that will open a Word 2007 (docx) document and update the appropriate CustomXmlPart (thus updating the Content Controls in the document itself as they are mapped to the CustomXmlPart) but can't work out how to save this as a new…
DilbertDave
  • 3,406
  • 3
  • 33
  • 42
12
votes
2 answers

OpenXml Table error "

elements are required before every "

I have created a Word template that I am then processing via the OpenXML SDK to replace some of the content of the document with data from a database query. The template consists of some basic text with Plain Text Content controls injected in the…
Martin Robins
  • 6,033
  • 10
  • 58
  • 95
12
votes
4 answers

OpenXML SDK Spreadsheet starter kits

I am trying to start working with Excel documents through the OpenXML SDK Spreadsheet API. But I haven't found any good guides or even examples on how to create a xlsx file from scratch. Only how to open an existing document and modify it. I have…
jmw
  • 2,864
  • 5
  • 27
  • 32
12
votes
1 answer

How to get the 'first' sheet in OOXML with C# and the SDK?

SO! :) Simple question -- it's probably been asked, but I could not find it. I am retrieving data from an XLSX using the Open XML SDK and C#. I want to get the "first" sheet (as in the first one you would see in Excel), but when I…
aikeru
  • 3,773
  • 3
  • 33
  • 48
12
votes
2 answers

Open XML - How to add a watermark to a docx document

I'm trying to take an existing document and if a header doesn't exist, create one, and then add a watermark to the header that says "DRAFT" diagonally. I've followed an example posted here and I've gotten the code to the point where it will add the…
Rob
  • 701
  • 3
  • 8
  • 21
12
votes
4 answers

how to create and download excel document using asp.net

How to create and download excel document using asp.net ? The purpose is to use xml, linq or whatever to send an excel document to a customer via a browser. Edit : Use case The customer load a gridview ( made with ajax framework ) in a browser, the…
belaz
  • 1,486
  • 5
  • 18
  • 33