Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

! in Worksheet Name #66

Open
DancePanda42 opened this issue Nov 23, 2017 · 0 comments
Open

! in Worksheet Name #66

DancePanda42 opened this issue Nov 23, 2017 · 0 comments

Comments

@DancePanda42
Copy link

Hi,

at first sorry for my bad english ;)

if i create a new ExcelPackage with an exist file ( new ExcelPackage( FileInfo file ) ) with a sheet that name contains a "!" and i try get the Workbook property then throw a NullReferenceException.

here the StackTrace:

  • ei OfficeOpenXml.ExcelRangeBase..ctor(ExcelWorksheet xlWorksheet, String address) in E:\EPPlus-master\EPPlus-master\EPPlus\ExcelRangeBase.cs:Zeile 112.
  • bei OfficeOpenXml.ExcelNamedRange..ctor(String name, ExcelWorksheet nameSheet, ExcelWorksheet sheet, String address, Int32 index) in E:\EPPlus-master\EPPlus-master\EPPlus\ExcelNamedRange.cs:Zeile 53.
  • bei OfficeOpenXml.ExcelNamedRangeCollection.Add(String Name, ExcelRangeBase Range) in E:\EPPlus-master\EPPlus-master\EPPlus\ExcelNamedRangeCollection.cs:Zeile 75.
  • bei OfficeOpenXml.ExcelWorkbook.GetDefinedNames() in E:\EPPlus-master\EPPlus-master\EPPlus\ExcelWorkbook.cs:Zeile 259.
  • bei OfficeOpenXml.ExcelPackage.get_Workbook() in E:\EPPlus-master\EPPlus-master\EPPlus\ExcelPackage.cs:Zeile 689.

the problem is in the "private void SetWbWs(string address)" methode in the ExcelAddress class
at the Row 323
grafik

the ExcelAddress class save the wrong sheetname
example: "sheetname!1" would be save as "sheetname"

the result is that in the method "internal void GetDefinedNames ()".
in the ExcelWorkbook class of line 259, an ExcelRangeBase with a null reference to the sheet is created.

if i remove the ! then all works fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant