Problem with VBA-code when saving data to xlsm-files

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: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Problem with VBA-code when saving data to xlsm-files

Postby johansamuelsson » Wed Oct 12, 2022 5:02 am

Hi

At my workplace we have started using Eviews 13 and having problems with xlsm-files that have VBA code.

When we are saving data to a larger xlsm-files, with multiple sheets, and with VBA-code, the file becomes corrupted. Excel says "We found a problem with some content in 'Test.Xlsm'. Do you want to try to recover as much as possible? Click yes if you trust the source of the workbook". When wee try to recover the file excel says that the VBA-code is removed.

The same code works fine in Eviews 12. Can we email you the files if you can run a test?

We use Eviews 13, Standar Edition – Oct 11 2022 build.

(If we delete all sheets except the sheet that we ar saving data to everything works fine)

Regards Johan

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

Re: Problem with VBA-code when saving data to xlsm-files

Postby EViews Jason » Wed Oct 12, 2022 2:59 pm

Hello Johann.

For EViews 13 we introduced a new Excel writing engine. The new engine apparently is not compatible with macro enabled Excel files (xlsm). If you could send me your xlsm file to jason@eviews.com, we will look into possibly fixing it.

In the meantime, use the 'legacy' option when writing your Excel files. This will use the same writing engine as EViews 12.

So if your old command was

Code: Select all

wfsave(type=excelxml, mode=update) test.xlsm

change it to:

Code: Select all

wfsave(type=excelxml, mode=update,legacy) test.xlsm

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

Re: Problem with VBA-code when saving data to xlsm-files

Postby johansamuelsson » Thu Oct 13, 2022 1:10 am

Ok, works fine with "legacy"-command. Perhaps the "legacy"-option should be the default for all-xlsm files when using wfsave

I am sending an email with two attached files, "Test.prg" and "Test.xlsm" so you can test

Thanks!

Regards Johan

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

Re: Problem with VBA-code when saving data to xlsm-files

Postby EViews Jason » Fri Dec 09, 2022 5:40 pm

This will be fixed in the next patch

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

Re: Problem with VBA-code when saving data to xlsm-files

Postby TomasThoren » Tue May 16, 2023 2:18 am

Hi,

i would just like to add to this thread that we have the same problem (excel files becomes corrupted when saved to), but also with ordinary excelfiles (.xlsx).

Kind regards
Tomas

Eviews 13 (Enterprise Edition – Apr 18 2023 build)


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests