Bug 152238 - FILESAVE: The structure of the book is broken when saving to LO in the .xlsm format in the case when the book (sheet) module has macros.
Summary: FILESAVE: The structure of the book is broken when saving to LO in the .xlsm ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2022-11-26 15:48 UTC by Vladimir Sokolinskiy
Modified: 2024-02-28 06:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Book_LO_Codename.xlsm (6.96 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2022-11-26 15:48 UTC, Vladimir Sokolinskiy
Details
Book.xlsm (10.71 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2022-11-26 15:49 UTC, Vladimir Sokolinskiy
Details
Book_LO.xlsm (6.15 KB, application/vnd.ms-excel.sheet.macroEnabled.12)
2022-11-26 15:50 UTC, Vladimir Sokolinskiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2022-11-26 15:48:52 UTC
Created attachment 183814 [details]
Book_LO_Codename.xlsm

Attached to the message is a book Book.xlsm created in Excel 2016. The CodeName of book is "MyWorkbook". Book has the sheet "Data" with CodeName "Sheet". The workbook module contains an empty Workbook_Open() macro.

Open Book.xlsm in LibreOffice and save as Book_LO.xlsm (see attachment).

Open the workbook Book_LO.xlsm in Excel. The VBE editor shows that the structure of the book is broken: there are three book modules.

In my opinion, the reason is that LO does not write the "Codename" attribute for the book tag "workbookPr" (\xl\workbook.xml) and sheet tag "sheetPr" (\xl\worksheets\sheet1.xml).

The book Book_LO_Codename.xlsm (see attachment) was created by manually adding the specified attributes to the Book_LO.xlsm archive. There are no problems opening this workbook in Excel.
Comment 1 Vladimir Sokolinskiy 2022-11-26 15:49:48 UTC
Created attachment 183815 [details]
Book.xlsm
Comment 2 Vladimir Sokolinskiy 2022-11-26 15:50:16 UTC
Created attachment 183816 [details]
Book_LO.xlsm
Comment 3 m_a_riosv 2022-11-26 23:08:41 UTC Comment hidden (obsolete)
Comment 4 Justin L 2022-11-27 00:17:22 UTC
I'm not sure why this would be marked as a duplicate. There is nothing in this report about making StarBASIC macros and then exporting to MS Formats.

This is just a round-tripping without modifications error report.
Comment 5 m_a_riosv 2022-11-27 11:53:21 UTC
My mistake. Sorry.
Comment 6 Mike Kaganski 2024-02-27 10:34:05 UTC
Repro using Version: 24.2.1.1 (X86_64) / LibreOffice Community
Build ID: 359ef544e625d2ffbfced462ab37bd593ca85fa7
CPU threads: 24; OS: Windows 10.0 Build 22631; UI render: default; VCL: win
Locale: ru-RU (en_US); UI: en-US
Calc: CL threaded