Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Commented Unassigned: Worksheet.Add fails with Unicode [15125]

$
0
0
I have tried to use version 4.0.1. But it fails when processing excel file with worksheets in Unicode (I'm using Microsoft Excel with Russian language).
Steps to reproduce error:
1) create ExcelPackage from excel file with 3 sheets: Template, Градуировка, Перецень АЦ
2) try to add list by copy sheet Template
```
xlPackage.Workbook.Worksheets.Add(sDate, template);
```
3) epplus fails with error "Vba module names can't contain unicode characters"

Version 3.1.3 works fine with the same excel file.
Comments: To reproduce this you have to rename any of workbook's VBA project elements into something containing non-unicode characters. Renaming a sheet won't lead to the error. So, you go into VBA project, select item representing any sheet or the worbook and change it's name in the properties window from "Sheet1" to "Лист1" (see attached image for visual guides); that's how VBA items are named in localizaed versions of Excel. Save workbook. Now, if you open this workbook with EPPlus and try adding a new sheet, you will get the exception. Obviously, you could rename all the elements in a workbook you are working with to avoid this issue, but this workaround isn't viable if you are working with documents from external sources. Moreover, you can't even pre-process the file somehow to rename the elements, since their names are embedded inside a pre-compiled binary part. All in all it would be great to hear the reasoning behind this "non-uncode-characters-only" limitation and get some robust workaround for it.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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