Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all 1877 articles
Browse latest View live

Commented Unassigned: Changing a Column Header's text [9383]

$
0
0
I am trying to change the text of cells in the first row of the spreadsheet, essentially the column header.

This example is just changing the first cell in row 1.

```
Dim l_sValue As String
l_sValue = "test"
wb.Worksheets(0).Cell(1, 1).DataType = XLCellValues.Text
wb.Worksheets(0).Cell(1, 1).Value = l_sValue
```

However, when I do this the spreadsheet needs to be repaired when I open it. If I change any cell other than a cell in row 1 I have no issues.

I need to modify the column headers so they have a better meaning and can't do this in the DataTable that I am importing from.
Comments: Is this issue fixed in ClosedXML 0.76.0 version ?

New Post: Vlookup function supported by Closedxml

New Post: Print Config Fit all Columns In One Page

$
0
0
Hi to all community,
I search al along the documentation but i have not found how to set the option "Fit all Columns in One Page", Can anyone give me an idea of how to set this option on my workSheet. Thanks.
Image

Closed Unassigned: Can't set header on non empty header [9500]

$
0
0
I am using this code to set the header on a document that already contains headers(first page and odd even) and it does not work.

pageSetup.Header.Center.AddText("first", XLHFOccurrence.FirstPage);
pageSetup.Header.Center.AddText("odd", XLHFOccurrence.OddPages);
pageSetup.Header.Center.AddText("even", XLHFOccurrence.EvenPages);

if i delete the headers, it does work.

using pageSetup.Header.Center.Clear(); does not work either.
Comments: Can't replicate.

Closed Unassigned: Table Theme [9499]

$
0
0
Attached is an excel file with a custom Table Style. The loading of the table theme borks because enum.parse can't find a value. Recommend changing the theme to a string and using enum.tryparse. Have a helper that lets you get standard excel themes but still allows custom theme names.

Commented Unassigned: Datetime is 1 day off [9497]

$
0
0
Greetings,

I'm trying to write a datetime to a cell using ClosedXML. I set the IXLCell DataType to be XLCellValues.DateTime, and the value to be a new DateTime. I also set the number format id to 14 (mm/dd/yyyy)

When I look at the excel sheet, the date displayed is always one day larger than anticipated. When I read the cell value using ClosedXML (in a unit test), the value read from the file matches the value I wrote, but the actual excel sheet does not show the correct value.

Is this a bug in ClosedXML or am I missing something?

Thanks!
-Adam
Comments: I'm using the latest codebase on the `develop` branch on Github and I can't replicate this problem. Here is my code; ```c# public void Create(String filePath) { var workbook = new XLWorkbook(); var worksheet = workbook.Worksheets.Add("Sample Sheet"); worksheet.Cell("A1").Value = "Hello World!"; var cell = worksheet.Cell("A2"); cell.Value = new DateTime(2016, 1, 1); cell.DataType = XLCellValues.DateTime; cell.Style.NumberFormat.NumberFormatId = 14; workbook.SaveAs(filePath); } ``` If I open the generated Excel file, I see "2016-01-01" in the cell. Can you please post a simple example to reproduce your problem?

Edited Unassigned: Store must be open for this operation [9495]

$
0
0
I am creating an excel file in excess of 40MB using the .net 4.5.1 framework with ClosedXML for .Net Framework 4.0. I save and reopen the file to append every 10000 rows to conserve memory. This error occurs when Save is executed.

Is there a workaround for the following error ? Does this error occur in the previous 3.5 DLL?

```
System.ObjectDisposedException: Store must be open for this operation.
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
at MS.Internal.IO.Packaging.PackagingUtilities.SafeIsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, ReliableIsolatedStorageFileFolder folder)
at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
at MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream()
at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
at System.Xml.XmlWellFormedWriter.WriteString(String text)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlPartRootElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart(OpenXmlPart openXmlPart)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents()
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose()
at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType)...
```

Commented Unassigned: Store must be open for this operation [9495]

$
0
0
I am creating an excel file in excess of 40MB using the .net 4.5.1 framework with ClosedXML for .Net Framework 4.0. I save and reopen the file to append every 10000 rows to conserve memory. This error occurs when Save is executed.

Is there a workaround for the following error ? Does this error occur in the previous 3.5 DLL?

```
System.ObjectDisposedException: Store must be open for this operation.
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
at MS.Internal.IO.Packaging.PackagingUtilities.SafeIsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, ReliableIsolatedStorageFileFolder folder)
at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
at MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream()
at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
at System.Xml.XmlWellFormedWriter.WriteString(String text)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
at DocumentFormat.OpenXml.OpenXmlPartRootElement.WriteTo(XmlWriter xmlWriter)
at DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart(OpenXmlPart openXmlPart)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents()
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing)
at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose()
at ClosedXML.Excel.XLWorkbook.CreatePackage(String filePath, SpreadsheetDocumentType spreadsheetDocumentType)...
```
Comments: Are you on Windows 8? According to http://stackoverflow.com/questions/35922941/store-must-be-open-for-this-operation-system-io-packaging-package there is a .NET hotfix available here, which should solve your problem: https://support.microsoft.com/en-us/kb/2996566 Please test it and confirm here.

Edited Unassigned: Error While loading excel generated from reporting tool [9494]

$
0
0
Hi,
I have generated one excel from reporting tool but while loading excel from below line is throwing exception.

```
XLWorkbook Workbook = new XLWorkbook(excelFileName);

{"Object reference not set to an instance of an object."}

at ClosedXML.Excel.XLWorkbook.LoadCells(SharedStringItem[] sharedStrings, Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, Dictionary2 sharedFormulasR1C1, XLWorksheet ws, Dictionary2 styleList, Cell cell, Int32 rowIndex)
at ClosedXML.Excel.XLWorkbook.LoadRows(Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, XLWorksheet ws, SharedStringItem[] sharedStrings, Dictionary2 sharedFormulasR1C1, Dictionary2 styleList, Row row)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
at ExcelReq.WebForm1.MergeExcel(String fileName, String location) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 25
at ExcelReq.WebForm1.Page_Load(Object sender, EventArgs e) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 16
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
```

please help me to resolve this issue.

please find aatached xml which is i m trying to load.

Commented Unassigned: Error While loading excel generated from reporting tool [9494]

$
0
0
Hi,
I have generated one excel from reporting tool but while loading excel from below line is throwing exception.

```
XLWorkbook Workbook = new XLWorkbook(excelFileName);

{"Object reference not set to an instance of an object."}

at ClosedXML.Excel.XLWorkbook.LoadCells(SharedStringItem[] sharedStrings, Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, Dictionary2 sharedFormulasR1C1, XLWorksheet ws, Dictionary2 styleList, Cell cell, Int32 rowIndex)
at ClosedXML.Excel.XLWorkbook.LoadRows(Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, XLWorksheet ws, SharedStringItem[] sharedStrings, Dictionary2 sharedFormulasR1C1, Dictionary2 styleList, Row row)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
at ExcelReq.WebForm1.MergeExcel(String fileName, String location) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 25
at ExcelReq.WebForm1.Page_Load(Object sender, EventArgs e) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 16
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
```

please help me to resolve this issue.

please find aatached xml which is i m trying to load.
Comments: Using the latest codebase from the `develop` branch on http://github.com/ClosedXML/ClosedXML , this workbook loads without problems. I'm marking this as fixed. If you still believe this is an issue, let us know on Github, with suitable examples.

Closed Unassigned: Error While loading excel generated from reporting tool [9494]

$
0
0
Hi,
I have generated one excel from reporting tool but while loading excel from below line is throwing exception.

```
XLWorkbook Workbook = new XLWorkbook(excelFileName);

{"Object reference not set to an instance of an object."}

at ClosedXML.Excel.XLWorkbook.LoadCells(SharedStringItem[] sharedStrings, Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, Dictionary2 sharedFormulasR1C1, XLWorksheet ws, Dictionary2 styleList, Cell cell, Int32 rowIndex)
at ClosedXML.Excel.XLWorkbook.LoadRows(Stylesheet s, NumberingFormats numberingFormats, Fills fills, Borders borders, Fonts fonts, XLWorksheet ws, SharedStringItem[] sharedStrings, Dictionary2 sharedFormulasR1C1, Dictionary2 styleList, Row row)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument dSpreadsheet)
at ClosedXML.Excel.XLWorkbook.LoadSheets(String fileName)
at ClosedXML.Excel.XLWorkbook.Load(String file)
at ClosedXML.Excel.XLWorkbook..ctor(String file, XLEventTracking eventTracking)
at ClosedXML.Excel.XLWorkbook..ctor(String file)
at ExcelReq.WebForm1.MergeExcel(String fileName, String location) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 25
at ExcelReq.WebForm1.Page_Load(Object sender, EventArgs e) in c:\users\pprateek\documents\visual studio 2010\Projects\ExcelReq\ExcelReq\WebForm1.aspx.cs:line 16
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
```

please help me to resolve this issue.

please find aatached xml which is i m trying to load.

Commented Unassigned: How to update/formatting existing excel (like template) file? [9491]

$
0
0
Please guide me for How to update/formatting existing excel (like template) file?

I have tried below code but it's give error.

// FilePath - c drive temp folder
string tempFile = FilePath + "Test.xlsx";

//Workbook formatting..... Start

XLWorkbook workbook = new XLWorkbook(tempFile);
IXLWorksheet worksheet = workbook.Worksheet(1);

worksheet.Cell(9, 1).Value = "AA";
workbook.SaveAs(tempFile);

//Workbook formatting..... End

Error: An item with the same key has already been added.

Please guide me. Thanks in Advance.

Comments: Please try with the latest version of ClosedXML (v0.80.1) and let me know if the error still occurs.

Created Unassigned: SaveAs changes existing format in excel sheets [9502]

$
0
0
I have already excel template which has already inserted with some formulas and formats to the cells.

This excel will open using application and saves necessary changes to sheets. and save the excel using saveas method.
wb = new XLWorkbook(FileName);
------
----
wb.CalculateMode = XLCalculateMode.Auto;
wb.SaveAs(FileName);

After saving, the excel formats are getting changed completely and calculations are going wrong. Percentage columns are changing to Date format. How can I proceed here by saving excel without changing existing formats. attached correct and incorrect excel.

Regards

New Post: Using embedded fonts

$
0
0
I need to use an unregistered font that I've embedded in my C# project as a resource following the process described here.

Is that possible?

New Post: Cannot convert theme color to color

$
0
0
Hi everyone,
I'm new to CLosedXML and so far it seems really interesting. However I have a problem that I cannot solve... Basically, what I'm doing, is opening an Excel file (with some layout and colors already applied) and fill it with data. In my code, I only enter data and formulas. I don't apply any cell formatting except from centering some data. However, when I save the workbook, I get the error "Cannot convert theme color to Color". I suspect the problems come from the file that I open or a bug in ClosedXML because if I open the file and immediately save it, I still have the same error on save. Any ideas about what could be the problem or if anything should be changed in the source file (through Excel)? By the way, I have no problem opening the source file in Excel...

I'm using VB.NET in Visual Studio 2015 if it helps.

Thanks

Jean

Updated Wiki: Documentation

$
0
0

We are moving!

The latest version of ClosedXML and its source code can now be downloaded from our GitHub repository.

Documentation is now maintained at https://github.com/ClosedXML/ClosedXML/wiki

 


 

Please don't ask questions on the comments section of the documentation pages because Codeplex doesn't send notifications for them. Please use the discussion tab instead. Thanks.

Requirements:

To use ClosedXML you must reference the DocumentFormat.OpenXml.dll:

DocumentFormat.OpenXml.dll for NET 4.0+

DocumentFormat.OpenXml.dll for NET 3.5

 

FAQ

How do I deliver an Excel file in ASP.NET?
Does it support Excel 2003 and prior formats (.xls)?
How can I insert an image?
Text with numbers are getting converted to numbers, what's up with that?
How do I get the result of a formula?

Examples

Showcase - No nonsense example of how to use this API
Basic Table
Hello World - Proverbial hello world program

Real world scenarios

Finding and extracting the data

Time Savers

Simplifying your life...

Performance and Memory

Turning off events
Better lambdas
Where to use the using keyword
Other performance improvements

Misc

Data Types - How to handle and convert cell's data types (Text, Boolean, DateTime, Numeric)
Creating Multiple Worksheets
Organizing Sheets
Loading and Modifying Files
Using Lambda Expressions
Cell Values
Workbook Properties
Using Formulas
Evaluating Formulas- New
Creating Rows/Columns Outlines
Hide Unhide Row(s)/Column(s)
Freeze Panes
Copying Worksheets
Using Hyperlinks
Data Validation
Hide Worksheets
Sheet Protection
Tab Colors
Conditional Formatting
Pivot Table example

Inserting Data/Tables

Copying IEnumerable Collections - Using "cell.Value = collection"
Inserting Data - Using "cell.InsertData(collection)"
Inserting Tables - Using "cell.InsertTable(collection)"
Adding DataTable as Worksheet
Adding DataSet

Styles

Styles - Alignment
Styles - Border
Styles - Fill
Styles - Font
Styles - NumberFormat
NumberFormatId Lookup Table
Style Worksheet
Style Rows and Columns
Using Default Styles
Using Colors
ClosedXML Predefined Colors
Excel Indexed Colors
Using Rich Text
Using Phonetics

Ranges

Defining Ranges
Merging Cells
Clearing Ranges
Deleting Ranges
Multiple Ranges
Shifting Ranges
Transpose Ranges
Named Ranges
Accessing Named Ranges- New
Copying Ranges
Using Tables
Sorting Data
Selecting Cells and Ranges

Rows

Row Height and Styles
Selecting Rows
Inserting Rows
Inserting and Deleting Rows
Adjust Row Height and Column Width to Contents
Row Cells

Columns

Column Width and Styles
Selecting Columns
Inserting Columns
Inserting and Deleting Columns
Adjust Row Height and Column Width to Contents
Column Cells

Page Setup (Print Options)

Pages Tab
Paper Size Lookup Table
Margins Tab
Headers and Footers Tab
Sheet Tab
Print Areas and Page Breaks

AutoFilters

Adding an AutoFilter to a Range
Filter Values
Custom Filters

Comments

Visibility
Position
Signatures
Style - Alignment
Style - Colors and Lines
Style - Size
Style - Protection
Style - Properties
Style - Margins
Style - Web

Closed Unassigned: SaveAs changes existing format in excel sheets [9502]

$
0
0
I have already excel template which has already inserted with some formulas and formats to the cells.

This excel will open using application and saves necessary changes to sheets. and save the excel using saveas method.
wb = new XLWorkbook(FileName);
------
----
wb.CalculateMode = XLCalculateMode.Auto;
wb.SaveAs(FileName);

After saving, the excel formats are getting changed completely and calculations are going wrong. Percentage columns are changing to Date format. How can I proceed here by saving excel without changing existing formats. attached correct and incorrect excel.

Regards
Comments: Please log at http://github.com/ClosedXML/ClosedXML if this is still an issue.

Closed Unassigned: Datetime is 1 day off [9497]

$
0
0
Greetings,

I'm trying to write a datetime to a cell using ClosedXML. I set the IXLCell DataType to be XLCellValues.DateTime, and the value to be a new DateTime. I also set the number format id to 14 (mm/dd/yyyy)

When I look at the excel sheet, the date displayed is always one day larger than anticipated. When I read the cell value using ClosedXML (in a unit test), the value read from the file matches the value I wrote, but the actual excel sheet does not show the correct value.

Is this a bug in ClosedXML or am I missing something?

Thanks!
-Adam

Commented Unassigned: Error doing data validation from another sheet [9498]

$
0
0
When using closedxml to add data validation to a file, all validations are written in the <x:dataValidations> element. However, this is not how excel saves data validation from other sheets.

Here's how closed xml saves it:

```
<x:dataValidations count="3">
<x:dataValidation type="list" errorStyle="warning" operator="between" allowBlank="0" showDropDown="0" showInputMessage="1" showErrorMessage="1" errorTitle="" error="" promptTitle="" prompt="" sqref="B6:B6">
<x:formula1>"Foo,Bar,FooBar"</x:formula1>
<x:formula2></x:formula2>
</x:dataValidation>
<x:dataValidation type="list" errorStyle="warning" operator="between" allowBlank="0" showDropDown="0" showInputMessage="1" showErrorMessage="1" errorTitle="" error="" promptTitle="" prompt="" sqref="C6:C6">
<x:formula1>'HiddenDataValSheet'!$A$1:$A$1000</x:formula1>
<x:formula2></x:formula2>
</x:dataValidation>
<x:dataValidation type="list" errorStyle="warning" operator="between" allowBlank="0" showDropDown="0" showInputMessage="1" showErrorMessage="1" errorTitle="" error="" promptTitle="" prompt="" sqref="D6:D6">
<x:formula1>'HiddenDataValSheet'!$B$1:$B$1000</x:formula1>
<x:formula2></x:formula2>
</x:dataValidation>
</x:dataValidations>

```

And here's how excel saves it:

```
<extLst>
<ext uri="{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main">
<x14:dataValidations count="2" xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
<x14:dataValidation type="list" errorStyle="warning" showInputMessage="1" showErrorMessage="1">
<x14:formula1>
<xm:f>HiddenDataValSheet!$A$1:$A$1000</xm:f>
</x14:formula1>
<xm:sqref>C6</xm:sqref>
</x14:dataValidation>
<x14:dataValidation type="list" errorStyle="warning" showInputMessage="1" showErrorMessage="1">
<x14:formula1>
<xm:f>HiddenDataValSheet!$B$1:$B$1000</xm:f>
</x14:formula1>
<xm:sqref>D6</xm:sqref>
</x14:dataValidation>
</x14:dataValidations>
</ext>

```

I'll need to modify the closed xml code to be able to read the data validations from the <extLst> element and treat them like normal data validations.
Comments: Do you perhaps have a test case to illustrate the problem and hence this fix?

Closed Unassigned: Closed XML Formatting Issue [9496]

$
0
0
When I cloned a copy of excel I have cells with no formatting means it's just plain white cells without any borders.

But once I save the excel using C# workbook.save() some weird lines appear

![Image](http://i.stack.imgur.com/DJKFj.png)

Please suggest any solution to this.

TIA
Comments: Please create an issue on http://github.com/ClosedXML/ClosedXML if this is still an issue.
Viewing all 1877 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>