Registered On: January 4, 2013, 11:22 pm
Number of Articles: 2262
Latest Snapshot: September 13, 2017, 5:20 pm
RSS URL:
http://epplus.codeplex.com/project/feeds/rss?projectrssfeed=codeplex://workitem/epplus
Publisher:
http://epplus.codeplex.com/WorkItem/List.aspx
Description: EPPlus Issue Tracker Rss Description
Catalog:
//epplus4.rssing.com/catalog.php?indx=7547932
December 6, 2016, 6:38 am
Hi ,
dll version : 4.0.5
I am using countifs formula then calculate function and after that when trying to get the cell value like ( String val22 = (String)SummarysheetModel.Cells[k, 201, k, 201].Value.ToString(); ) , system getting slow at debugging and release mode.
I have lots of entries in Excel worksheet and want to calculate each cell and show in new worksheet.
Please let me know if this is a correct to get the cell value.
sheet["B3"].Formula = "COUNTIFS(Data!V:V,\"CODE\",Data!AL:AL,\"MODEL\")";
sheet.Cells[k, 201, k, 201].Calculate();
String val22 = (String)sheet.Cells[k, 201, k, 201].Value.ToString();
Comments: Can someone please suggest the solution ?
after this simple piece of code the excel to load this file.
```
[TestClass]
public class UnitTest1
{
private string TemplateFileName = @".\templates\TestWithPivotTablePointingToExcelTableForData.xlsx";
private string ExportFileName = @".\templates\TestWithPivotTablePointingToExcelTableForData_Export.xlsx";
[TestMethod]
public void TestWithPivotTablePointingToExcelTableForData()
{
using (ExcelPackage excelpackage = new ExcelPackage(new FileInfo(TemplateFileName), true))
{
excelpackage.SaveAs(new FileInfo(ExportFileName));
}
}
}
```
as far as i can tell it occures when there is a pivottable in the sheet which points to an exceltable as datasource.
In the attachments i've added an example file.
excel error
Faulting application name: EXCEL.EXE, version: 16.0.4456.1003, time stamp: 0x58139d4f
Faulting module name: EXCEL.EXE, version: 16.0.4456.1003, time stamp: 0x58139d4f
Exception code: 0xc0000005
Fault offset: 0x01134c41
Faulting process id: 0x3184
Faulting application start time: 0x01d2507cb589c304
Faulting application path: C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.EXE
Faulting module path: C:\Program Files (x86)\Microsoft Office\Office16\EXCEL.EXE
Report Id: f3cbc25f-bc6f-11e6-82c7-90e6ba1a467a
Faulting package full name:
Faulting package-relative application ID:
I have a client that uses workbooks with what amounts to a worksheet per calendar week in it. Each sheet builds on the previous one, etc. Each sheet has 2 different images in it. For their customers, each sheet is extracted and saved to a web server for them to view/download. EPPLUS is used for this.
The problem we're having is that in the extracted sheets the resultant sheet is displaying one of the images in both locations. The file (xlsx) has both images in it OK, but the xml only references one of them so it looks like only one image is in there. This worked correctly in 4.0.4 - i.e. you got both images properly, but in 4.0.5 and 4.1 the problem appears.
This is what we do to extract the sheet:
ExcelPackage package = new ExcelPackage(new System.IO.FileInfo(path + src));
ExcelWorksheet Sheet = package.Workbook.Worksheets[TabName];
string FileName = (path + src).Replace(".xlsx", " - " + TabName + ".xlsx");
if (File.Exists(FileName))
File.Delete(FileName);
ExcelPackage p = new ExcelPackage(new FileInfo(FileName));
p.Workbook.Worksheets.Add(Sheet.Name, Sheet);
p.Save();
Any ideas?
There is an issue with saving a workbook which contains a Pivot Table based on a Named Range.
Please find attached three workbooks which suffer from this issue. To replicate the issue, just open one of these workbooks with EPPlus and save.
EPPlus throws "Object reference not set to an instance of an object" in line 3191, ExcelWorksheet.cs, because variable "ws" is set to null.
Comments: This issue is already in an item, the 15266.
I have tryed the 2 solutions but kepp having compilation errors...
I hope this issue will be corrected sooner.
Latest version throwing an exception in ExcelWorkSheet.cs method SavePivotTables when using a template with pivot tables.
problem line
```
var ws = Workbook.Worksheets[pt.CacheDefinition.SourceRange.WorkSheet];
```
SourceRange is null in the Sheet I am saving.
Comments: A new item was created on that, 15421.
I hope that this issue will be fixed sooner because I have tryed the solutions but kepp having compilation errors.
December 9, 2016, 6:49 am
```
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at OfficeOpenXml.ExcelNamedRangeCollection.AddName(String Name, ExcelNamedRange item)
at OfficeOpenXml.ExcelNamedRangeCollection.Add(String Name, ExcelRangeBase Range)
at OfficeOpenXml.ExcelWorkbook.GetDefinedNames()
at OfficeOpenXml.ExcelPackage.get_Workbook()
```
Here is code:
``` C#
using (var pck = new ExcelPackage())
{
pck.Load(readStream);
foreach (var worksheet in pck.Workbook.Worksheets)
// ...
}
```
Spreadsheet file is attached.
I think correct behavior is to merge or overwrite ranges with same name. Not to throw exceptions.
December 12, 2016, 3:35 am
I've created a worksheet with a table in it. The table has formulas like [Column A]-[Column B].
When calculating, all values become #NAME, even though they work in Excel.
I've traced it down to DependencyChainFactory line 222, where table column names are completely ignored. I'm guessing the fact that the cells lack a reference to their containing table is part of the reason why it's not implemented. :)
Would be really nice if this works.
My current use-case is automated testing of the created Excel file, including formulas written into it.
Hi,
Currently EPPlus cannot be used as part of the .NET Core application. I get this error:
```
Restoring packages for D:\Projects\ConsoleApp1\ConsoleApp1.csproj...
Package EPPlus 4.1.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package EPPlus 4.1.0 supports:
- net35 (.NETFramework,Version=v3.5)
- net40 (.NETFramework,Version=v4.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
Package restore failed. Rolling back package changes for 'ConsoleApp1'.
========== Finished ==========
Time Elapsed: 00:00:00.5826719
```
Please add support of .NET Core apps
Hi,
We are using this library(version 2.8) in a custom user control which is used in sharepoint 2010 application. We are facing the issue mentioned [here](http://epplus.codeplex.com/workitem/14762). When we tried to upgrade to EPPlus 4.1, we are getting compatibility problems. Doesn't this library is supported in sharepoint 2010 or .Net framework 3.5 sp1?
Regards,
Srikanth B
Latest version throwing an exception in ExcelWorkSheet.cs method SavePivotTables when using a template with pivot tables.
problem line
```
var ws = Workbook.Worksheets[pt.CacheDefinition.SourceRange.WorkSheet];
```
SourceRange is null in the Sheet I am saving.
Comments: A new item was created on that, 15421.
I hope that this issue will be fixed sooner because I have tryed the solutions but kepp having compilation errors.
December 22, 2016, 10:02 am
I got the following exception with the latest version 4.1.0. When I reverted back to 4.0.5 I stopped getting the error.
__Method Called:__
ws.InsertRow(28, 1);
__Call Stack:__
```System.ArgumentOutOfRangeException
Row cannot be less than 1. Parameter name: value
System.ArgumentOutOfRangeException: Row cannot be less than 1.
Parameter name: value
at OfficeOpenXml.ExcelCellAddress.set_Row(Int32 value)
at OfficeOpenXml.ExcelNamedRangeCollection.InsertRows(Int32 rowFrom, Int32 rows, ExcelNamedRange namedRange)
at OfficeOpenXml.ExcelNamedRangeCollection.Insert(Int32 rowFrom, Int32 colFrom, Int32 rows, Int32 cols, Func`2 filter)
at OfficeOpenXml.ExcelWorksheet.InsertRow(Int32 rowFrom, Int32 rows, Int32 copyStylesFromRow)
```
_xlPackage.Workbook.Worksheets.Add("TedsWizard", _xlPackage.Workbook.Worksheets["Wizard"]);
or
_xlPackage.Workbook.Worksheets.Copy("Wizard", "TedsWizard");
All I get is a null reference error
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=EPPlus
StackTrace:
at OfficeOpenXml.ExcelWorksheets.Add(String Name, ExcelWorksheet Copy)
at OfficeOpenXml.ExcelWorksheets.Copy(String Name, String NewName)
I can add values to the "Wizard" Worksheet but I can't copy it
Comments: Is there a workaround for this issue?
when having a template with existing filters and then trying to delete some column will lead to a crash.
The issue is in file "ExcelNamedRangeCollection.cs" and function "internal void Delete(int rowFrom, int colFrom, int rows, int cols, Func<ExcelNamedRange, bool> filter)":
```
if (rows==0)
```
should be
```
if (columns > 0 && fromRow == 0 && rows >= ExcelPackage.MaxRows)
```
because the "delete" function is called in file: "ExcelWorksheet.cs" inside function: "public void DeleteColumn(int columnFrom, int columns)" with line
```
_names.Delete(0, columnFrom, ExcelPackage.MaxRows, columns);
```
which results in
```
if (rows==0)
```
could never be true.
when having a template with existing filters and then trying to delete some column will lead to a crash.
The issue is in file "ExcelNamedRangeCollection.cs" and function "internal void Delete(int rowFrom, int colFrom, int rows, int cols, Func<ExcelNamedRange, bool> filter)":
```
if (rows==0)
```
should be
```
if (columns > 0 && fromRow == 0 && rows >= ExcelPackage.MaxRows)
```
because the "delete" function is called in file: "ExcelWorksheet.cs" inside function: "public void DeleteColumn(int columnFrom, int columns)" with line
```
_names.Delete(0, columnFrom, ExcelPackage.MaxRows, columns);
```
which results in
```
if (rows==0)
```
could never be true.
Comments: Fixed in changeset 33392c36678d
I open and save an xlsm file containing shared formulas having error values with EPPlus 4.1.0 like this:
```
var fi = new FileInfo("sharedFormulas.xlsm");
var package = new ExcelPackage(fi);
package.Save();
```
After saving the package, Excel couldn't open the file. It looks like the cells aren't marked as error typed.
The formulas contain user defined functions, but they don't seem to be the problem.
I attach the file before saving with EPPlus.