Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSSFWorkbook object cannot be created from filestream due to system date format setting #1421

Open
1 task
Prim-Wer opened this issue Sep 16, 2024 · 3 comments
Labels

Comments

@Prim-Wer
Copy link

Prim-Wer commented Sep 16, 2024

NPOI Version

NPOI.2.3.0

File Type

  • XLSX

Upload the Excel File

Should not be file related
SE_Properties_Template.xlsx

Reproduce Steps

Opening Excel file with regional / date settings dd/mm/yyyy failed (English (Austria))
Changing date format to dd.mm.yyyy (German (Austria) is successfull

Issue Description

I'm trying to create a XSSFWorkbook object for an Excel .xlsx file like this
using (fs = File.OpenRead(filePath)) { workbook = new XSSFWorkbook(fs);
in the line new XSSFWorkbook(fs) (File exists and filestream is open) the code crashes with the error
System.ArgumentException: '1 ist keine unterstützte Codepage.
Parametername: codepage'

When i change the systems date settings to German (Austria) dd.mm.yyyy style the object can be created.

How can i set up the initialisation, that this works with any language / date setting?

@Prim-Wer Prim-Wer added the bug label Sep 16, 2024
@tonyqus
Copy link
Member

tonyqus commented Sep 16, 2024

.docx? Are you sure?

@tonyqus
Copy link
Member

tonyqus commented Sep 16, 2024

NPOI 2.3.0 is an ancient version. Can you upgrade your nuget package to the latest one and try again?

@Prim-Wer
Copy link
Author

.docx? Are you sure?
thank you, corrected the mistake, obviously xlsx

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

No branches or pull requests

2 participants