Corrupt xlsx file using non-english characters

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

johansamuelsson
Posts: 165
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Corrupt xlsx file using non-english characters

Postby johansamuelsson » Sat Nov 26, 2022 12:07 am

When I use Swedish specific letters such as å,ä and ö, the excel file becomes corrupt. See examples

Code: Select all

WfCreate(page=u) u 1 ' EXAMPLE 1 Table Table1 Table1(1,1) = "åäö" Table1.save(t=xlsx) c:\temp\Table1.xlsx Range=Sheet1!a1 ' EXAMPLE 2 Alpha Alpha1="åäö" WfSave(type=excelxml, cellfmt=eviews) C:\Temp\Alpha1.xlsx @keep Alpha1 ' EXAMPLE 3 Series Series1=1 Series1.Label(d) åäö WfSave(type=excelxml, cellfmt=eviews, attr) C:\Temp\Series1.xlsx @keep Series1 ' EXAMPLE 4 an 5 (this works, there seems not to be a legacy-option for table.save) WfSave(type=excelxml, cellfmt=eviews, legacy) C:\Temp\Alpha2.xlsx @keep Alpha1 WfSave(type=excelxml, cellfmt=eviews, attr, legacy) C:\Temp\Series2.xlsx @keep Series1
Eviews 13 Nov 9 2022 build

Regards Johan

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Corrupt xlsx file using non-english characters

Postby EViews Jason » Mon Nov 28, 2022 8:50 am

We will investigate the new Excel writing engine. In the meantime use the 'legacy' option to revert back to the old engine when using wfsave.

Code: Select all

WfSave(type=excelxml, cellfmt=eviews,legacy) C:\Temp\Alpha1.xlsx @keep Alpha1
Writing to Excel files via Table.save however is new EViews 13 feature. The 'legacy' option is therefore currently not supported. We will look into adding it in a future patch.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Corrupt xlsx file using non-english characters

Postby EViews Jason » Thu Dec 08, 2022 11:53 am

The ability to save xlsx files containing non-english characters using the new EViews 13 Excel writing engine will be fixed in the next patch.

johansamuelsson
Posts: 165
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: Corrupt xlsx file using non-english characters

Postby johansamuelsson » Thu Dec 08, 2022 12:02 pm

Wonderful news!

TomasThoren
Posts: 7
Joined: Wed Sep 30, 2020 3:08 am

Re: Corrupt xlsx file using non-english characters

Postby TomasThoren » Wed Jan 08, 2025 4:17 am

Hi Forum,

picking up this thread since I still experince issues when writing to excelfiles with pagenames containing non-english characters.

Below I have two lines of code writing to excel via PageSave, one without non-english character in the pagename of the excel file and one with a "å" in the pagename. The latter not working (the excelfile becomes corrupt and is unrepairable).

Code: Select all

%data = "@date" %cell = "A333"
This line works (pagename "Radata"):

Code: Select all

PageSave(t=excelxml,Mode=Update,noid) {%L_Sok_pro_lok}{%OmrKod}_inm_pro.xlsx Range=Radata_a!{%cell} byrow @keep {%data} @Smpl !L_Tid_Start !G_Tid_ProHor
This one doesn't (pagename "Rådata"):

Code: Select all

PageSave(t=excelxml,Mode=Update,noid) {%L_Sok_pro_lok}{%OmrKod}_inm_pro.xlsx Range=Rådata_a!{%cell} byrow @keep {%data} @Smpl !L_Tid_Start !G_Tid_ProHor

I read that there was a patch coming to Eivews13 (from a reply 8th of December 2022), but I'm still experince this issue.

Kind regards
Tomas

I'm using Eviews14 Enterprise Edition - Oct 22 2024 build.

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Corrupt xlsx file using non-english characters

Postby EViews Steve » Wed Jan 08, 2025 11:28 am

Is your Windows Language setting set to Swedish? If not, try switching to that and try the pagesave cmd again.

TomasThoren
Posts: 7
Joined: Wed Sep 30, 2020 3:08 am

Re: Corrupt xlsx file using non-english characters

Postby TomasThoren » Wed Feb 05, 2025 5:22 am

Hi Steve,

Thank you for your reply. Yes, the Windows Language setting is set to Swedish. So that doesn't seem to be the problem.

Kind regards
Tomas

henriksiverbo
Posts: 3
Joined: Thu Sep 18, 2025 6:52 am

Re: Corrupt xlsx file using non-english characters

Postby henriksiverbo » Thu Oct 09, 2025 7:33 am

Hi,

Picking up this thread again due to the issue with currupt xlsx-files still happening when writing to xlsx-files using pagesave. Judging from earlier posts, it seems the problem with non-english characters (like å,ä,ö) initially happened when writing any kind of information to Excel. The problem has since then been solved for contents with non-english characters. It remains a problem however to write to a worksheet if the sheet name contains non-english characters. The xlsx-file will then be treated as corrupt by Excel.

In my understanding what happens is as follows.
1. Using pagesave, if the Excel target sheet name contains a non-english character Eviews will not identify and encode this character correctly and therefore try to add a new worksheet to write the data to (since this is what happens if the target sheet does not exist).
2. When adding the new worksheet Eviews is replacing the non-english character by a character not allowed by Excel (⍰). When the xslx-file is then opened in Excel it is treated as corrupt.
3. If accessing the underlying xml-files the incorrectly encoded character ⍰ can be replaced by one that is allowed and the xlsx-file will then be restored (and containing the new worksheet Eviews added, with the data written to it).

In conclusion, the issue seems to be that the encoding of non-english characters in target sheet names is faulty, which I'm guessing the Eviews Team could fix in the same way it fixed writing non-english characters as part of worksheet contents.

Best regards,
Henrik

Eviews14 Enterprise Edition - Oct 22 2024 build

henriksiverbo
Posts: 3
Joined: Thu Sep 18, 2025 6:52 am

Re: Corrupt xlsx file using non-english characters

Postby henriksiverbo » Thu Dec 18, 2025 4:19 am

It would be useful to know if you are planning to address this issue in upcoming patches to Eviews 14?

Best regards,
Henrik

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13583
Joined: Tue Sep 16, 2008 5:38 pm

Re: Corrupt xlsx file using non-english characters

Postby EViews Gareth » Thu Dec 18, 2025 8:53 am

We haven't yet determined if a fix is possible, but we are looking in to it.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest