After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725220 - xls file with vba macro corrupted by gnumeric when re-saved
xls file with vba macro corrupted by gnumeric when re-saved
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export MS Excel (tm)
1.10.x
Other Linux
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-02-26 13:22 UTC by Hugh
Modified: 2014-02-26 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Original file with VBA macro created in Excel (33.00 KB, application/vnd.ms-excel)
2014-02-26 13:22 UTC, Hugh
Details

Description Hugh 2014-02-26 13:22:18 UTC
Created attachment 270383 [details]
Original file with VBA macro created in Excel

When an xls file with a small vba macro is opened, modified and re-saved by gnumeric (v 1.10.17), it can no longer be opened by Excel.  There is an error message to say that a file can't be found or a vba library is missing.

I have attached an example called Test_original.xls.

I tried again after removing the macro completely using Excel.  When this new file was modifed and re-saved in gnumeric, the resulting file still could not be read by Excel with the same error messages.

I persevered with the file that had the macro stripped out of it.  I tried using "save as" in gnumeric instead of just re-saving it but this made no difference.  I then re-opened the file that had been saved in gnumeric and used "save as" again.  I then at last had a file that could be opened by Excel.  However, it didn't solve the problem with the original file with the macro.

I have other samples of the files generated at the various steps above but wasn't able to make further attachments.

I don't expect gnumeric to be able to run VBA macros in the near future but surely it should preserve them so that the file can still work in Excel.  This is important for sharing work.
Comment 1 Morten Welinder 2014-02-26 13:56:38 UTC
I can confirm that Excel is unhappy with the file we produce.  A quick look
suggests that we store the VBA files in the wrong directory on save, but
that might really just be the tip of the iceberg.

# gsf list ~/Download/Test_original.xls
/home/welinder/Download/Test_original.xls:
d  2014-02-24 07:41:49           0 *root*
f                               20 Ole
f                              102 CompObj
f                            12061 Workbook
d  2014-02-24 07:41:49           0 _VBA_PROJECT_CUR
d  2014-02-24 07:41:49           0 _VBA_PROJECT_CUR/VBA
f                              823 _VBA_PROJECT_CUR/VBA/dir
f                              971 _VBA_PROJECT_CUR/VBA/Sheet1
f                              971 _VBA_PROJECT_CUR/VBA/Sheet2
f                             1188 _VBA_PROJECT_CUR/VBA/Sheet3
f                              677 _VBA_PROJECT_CUR/VBA/Module1
f                             1931 _VBA_PROJECT_CUR/VBA/__SRP_0
f                              126 _VBA_PROJECT_CUR/VBA/__SRP_1
f                              620 _VBA_PROJECT_CUR/VBA/__SRP_2
f                              101 _VBA_PROJECT_CUR/VBA/__SRP_3
f                              218 _VBA_PROJECT_CUR/VBA/__SRP_4
f                               64 _VBA_PROJECT_CUR/VBA/__SRP_5
f                             2004 _VBA_PROJECT_CUR/VBA/AutoOpen
f                              979 _VBA_PROJECT_CUR/VBA/ThisWorkbook
f                             3442 _VBA_PROJECT_CUR/VBA/_VBA_PROJECT
f                              593 _VBA_PROJECT_CUR/PROJECT
f                              155 _VBA_PROJECT_CUR/PROJECTwm
f                              140 SummaryInformation
f                              416 DocumentSummaryInformation

# gsf list ~/ttt.xls 
/home/welinder/ttt.xls:
d                                0 *root*
d                                0 VBA
f                              823 VBA/dir
f                              971 VBA/Sheet1
f                              971 VBA/Sheet2
f                             1188 VBA/Sheet3
f                              677 VBA/Module1
f                             1931 VBA/__SRP_0
f                              126 VBA/__SRP_1
f                              620 VBA/__SRP_2
f                              101 VBA/__SRP_3
f                              218 VBA/__SRP_4
f                               64 VBA/__SRP_5
f                             2004 VBA/AutoOpen
f                              979 VBA/ThisWorkbook
f                             3442 VBA/_VBA_PROJECT
f                              102 CompObj
f                            12219 Workbook
f                              140 SummaryInformation
f                              243 DocumentSummaryInformation
Comment 2 Morten Welinder 2014-02-26 14:47:27 UTC
I have improved the situation, but Excel still isn't happy.

d                                0 *root*
f                              102 CompObj
f                            12219 Workbook
d                                0 _VBA_PROJECT_CUR
d                                0 _VBA_PROJECT_CUR/VBA
f                              823 _VBA_PROJECT_CUR/VBA/dir
f                              971 _VBA_PROJECT_CUR/VBA/Sheet1
f                              971 _VBA_PROJECT_CUR/VBA/Sheet2
f                             1188 _VBA_PROJECT_CUR/VBA/Sheet3
f                              677 _VBA_PROJECT_CUR/VBA/Module1
f                             1931 _VBA_PROJECT_CUR/VBA/__SRP_0
f                              126 _VBA_PROJECT_CUR/VBA/__SRP_1
f                              620 _VBA_PROJECT_CUR/VBA/__SRP_2
f                              101 _VBA_PROJECT_CUR/VBA/__SRP_3
f                              218 _VBA_PROJECT_CUR/VBA/__SRP_4
f                               64 _VBA_PROJECT_CUR/VBA/__SRP_5
f                             2004 _VBA_PROJECT_CUR/VBA/AutoOpen
f                              979 _VBA_PROJECT_CUR/VBA/ThisWorkbook
f                             3442 _VBA_PROJECT_CUR/VBA/_VBA_PROJECT
f                              140 SummaryInformation
f                              243 DocumentSummaryInformation


We seem to drop
f                              593 _VBA_PROJECT_CUR/PROJECT
f                              155 _VBA_PROJECT_CUR/PROJECTwm

as well as the
f                               20 Ole
Comment 3 Morten Welinder 2014-02-26 15:03:36 UTC
The Ole member (which is really called \001Ole) now survives.  Still not
enough.

/home/welinder/ttt.xls:
d                                0 *root*
f                               20 Ole
f                              102 CompObj
f                            12219 Workbook
d                                0 _VBA_PROJECT_CUR
d                                0 _VBA_PROJECT_CUR/VBA
f                              823 _VBA_PROJECT_CUR/VBA/dir
f                              971 _VBA_PROJECT_CUR/VBA/Sheet1
f                              971 _VBA_PROJECT_CUR/VBA/Sheet2
f                             1188 _VBA_PROJECT_CUR/VBA/Sheet3
f                              677 _VBA_PROJECT_CUR/VBA/Module1
f                             1931 _VBA_PROJECT_CUR/VBA/__SRP_0
f                              126 _VBA_PROJECT_CUR/VBA/__SRP_1
f                              620 _VBA_PROJECT_CUR/VBA/__SRP_2
f                              101 _VBA_PROJECT_CUR/VBA/__SRP_3
f                              218 _VBA_PROJECT_CUR/VBA/__SRP_4
f                               64 _VBA_PROJECT_CUR/VBA/__SRP_5
f                             2004 _VBA_PROJECT_CUR/VBA/AutoOpen
f                              979 _VBA_PROJECT_CUR/VBA/ThisWorkbook
f                             3442 _VBA_PROJECT_CUR/VBA/_VBA_PROJECT
f                              140 SummaryInformation
f                              243 DocumentSummaryInformation
Comment 4 Morten Welinder 2014-02-26 15:23:15 UTC
After handling the PROJECT files too, Excel happily loads the file.

/home/welinder/ttt.xls:
d                                0 *root*
f                               20 Ole
f                              102 CompObj
f                            12219 Workbook
d                                0 _VBA_PROJECT_CUR
d                                0 _VBA_PROJECT_CUR/VBA
f                              823 _VBA_PROJECT_CUR/VBA/dir
f                              971 _VBA_PROJECT_CUR/VBA/Sheet1
f                              971 _VBA_PROJECT_CUR/VBA/Sheet2
f                             1188 _VBA_PROJECT_CUR/VBA/Sheet3
f                              677 _VBA_PROJECT_CUR/VBA/Module1
f                             1931 _VBA_PROJECT_CUR/VBA/__SRP_0
f                              126 _VBA_PROJECT_CUR/VBA/__SRP_1
f                              620 _VBA_PROJECT_CUR/VBA/__SRP_2
f                              101 _VBA_PROJECT_CUR/VBA/__SRP_3
f                              218 _VBA_PROJECT_CUR/VBA/__SRP_4
f                               64 _VBA_PROJECT_CUR/VBA/__SRP_5
f                             2004 _VBA_PROJECT_CUR/VBA/AutoOpen
f                              979 _VBA_PROJECT_CUR/VBA/ThisWorkbook
f                             3442 _VBA_PROJECT_CUR/VBA/_VBA_PROJECT
f                              593 _VBA_PROJECT_CUR/PROJECT
f                              155 _VBA_PROJECT_CUR/PROJECTwm
f                              140 SummaryInformation
f                              243 DocumentSummaryInformation

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.