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

New Post: How to check if the cell has an (formular) error?

$
0
0
Hi, is there a function to check, that the cell has an error?
When I try to get a value from a cell with an (formular) error, the value property throws an exception.

It would be even better, when the formular function IFERROR were supported.

New Post: Error While loading the excel

$
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.

Created 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: waiting for solution.

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: waiting for solution

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: HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

Commented Unassigned: Multiple SaveAs calls causes InvalidCastException [9483]

$
0
0
Version 0.76.0, Test case:

```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs("test.xlsx");
ret.Cell("A1").Value = "test";
w.SaveAs("test"xlsx");
```

The first save succedes, the second one fails with error:

System.InvalidCastException: Unable to cast object of type 'DocumentFormat.OpenXml.Packaging.SharedStringTablePart' to type 'DocumentFormat.OpenXml.Packaging.WorksheetPart'.

Workaround:
```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs(test.xlsx);
w = new XLWorkbook(test.xlsx);
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test");
w.Save();
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test2");
w.Save();
```

I also tried Save() after first SaveAs() but it says that I cannot use "Save" for new files.
Comments: Have you made any progress on this issue?

Commented Unassigned: Multiple SaveAs calls causes InvalidCastException [9483]

$
0
0
Version 0.76.0, Test case:

```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs("test.xlsx");
ret.Cell("A1").Value = "test";
w.SaveAs("test"xlsx");
```

The first save succedes, the second one fails with error:

System.InvalidCastException: Unable to cast object of type 'DocumentFormat.OpenXml.Packaging.SharedStringTablePart' to type 'DocumentFormat.OpenXml.Packaging.WorksheetPart'.

Workaround:
```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs(test.xlsx);
w = new XLWorkbook(test.xlsx);
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test");
w.Save();
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test2");
w.Save();
```

I also tried Save() after first SaveAs() but it says that I cannot use "Save" for new files.
Comments: Yes. I just don't do it. It looks like it is a DocumentFormat.OpenXML issue. I changed my code to open and close XLWorkbook on every save.

Commented Unassigned: Multiple SaveAs calls causes InvalidCastException [9483]

$
0
0
Version 0.76.0, Test case:

```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs("test.xlsx");
ret.Cell("A1").Value = "test";
w.SaveAs("test"xlsx");
```

The first save succedes, the second one fails with error:

System.InvalidCastException: Unable to cast object of type 'DocumentFormat.OpenXml.Packaging.SharedStringTablePart' to type 'DocumentFormat.OpenXml.Packaging.WorksheetPart'.

Workaround:
```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs(test.xlsx);
w = new XLWorkbook(test.xlsx);
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test");
w.Save();
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test2");
w.Save();
```

I also tried Save() after first SaveAs() but it says that I cannot use "Save" for new files.
Comments: Thanks for info. I did the same.

Commented Unassigned: Multiple SaveAs calls causes InvalidCastException [9483]

$
0
0
Version 0.76.0, Test case:

```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs("test.xlsx");
ret.Cell("A1").Value = "test";
w.SaveAs("test"xlsx");
```

The first save succedes, the second one fails with error:

System.InvalidCastException: Unable to cast object of type 'DocumentFormat.OpenXml.Packaging.SharedStringTablePart' to type 'DocumentFormat.OpenXml.Packaging.WorksheetPart'.

Workaround:
```
XLWorkbook w = new XLWorkbook();
IXLWorksheet ret = w.Worksheets.Add("test");
w.SaveAs(test.xlsx);
w = new XLWorkbook(test.xlsx);
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test");
w.Save();
w.Worksheets.Worksheet("test").Cell("A1").SetValue<string>("test2");
w.Save();
```

I also tried Save() after first SaveAs() but it says that I cannot use "Save" for new files.
Comments: blackzork,masihemami: Please open an issue for OpenXML SDK: [OfficeDev/Open-XML-SDK](https://github.com/OfficeDev/Open-XML-SDK)

Created 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. Is there a workaround for the following error or should i revert to .net 3.5?

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)...

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: This error occurs when a Save is executed.

Commented Unassigned: Improve performance [9425]

$
0
0
Hi
There is room for performance improvements in ClosedXML.

To create a performance base line I updated the sandbox example in the branch https://closedxml.codeplex.com/SourceControl/network/forks/AlbinSunnanbo/closedxml?branch=Performance_Example to create a Excel document similar to our production code
(See change set https://closedxml.codeplex.com/SourceControl/network/forks/AlbinSunnanbo/closedxml/changeset/6aedcc8946cc210a4f81224f8e65f2f4feb0ee10 )

I created a pull request with some low hanging fruit fixes: https://closedxml.codeplex.com/SourceControl/network/forks/AlbinSunnanbo/closedxml/contribution/8065

Before the pull request the execution time on my computer was 9.8 seconds, with the pull request applied the execution time was 6.7 seconds. That's an overall 30% improvement on a generate + save cycle.

I have some further fixes in the works, I'll add comments to this issue when the are ready.

// Albin Sunnanbo @ Kentor
Comments: Life in my world has finally come to the point where the performance improvements would be really useful. Would it be possible to wrap up a release with an updated NuGet package? // Albin

New Post: Columns.AdjustToContents - Problem with formula result

$
0
0
MDeLeon,

I still have the issue even with latest version. I have formula in cells and when I run Columns.AdjustToContents() it still shows'#####'. Please advise!

New Post: Is it possible to make a excel sheet right to left with closedXML

$
0
0
Is it possible to make a excel sheet right to left with closedXML

New Comment on "Conditional Formatting"

$
0
0
I getting error while trying to save an Excel file which is opened using closedxml and contains conditional formatting. I have added a new sheet. Any Idea how to solve this.

Reviewed: ClosedXML 0.76.0 (jún. 14, 2016)

$
0
0
Rated 5 Stars (out of 5) - Very useful, rich in features!

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: This is because the format is only permitted excel 2007, does not work with libreoffice or any other spreadsheet so be formatted with xlsx The only option is that you edit and save the file from Excel 2007.

New Comment on "Sheet Protection"

Viewing all 1877 articles
Browse latest View live