Created attachment 182883 [details] autoOpenClose.xls: various oddities with auto_open in Excel The auto_ functions are not supposed to run from ThisWorkbook (Excel 2003/2010). This changed in LO 7.4 with commit beb6c62e990599d91ac5d9183164c94d269027d3 Author: Tomaž Vajngerl on Mon Jan 31 15:46:30 2022 +0900 vba: fix registering shortcuts keys defined by the vba macros
Steps to reproduce 1.) Open autoOpenClose.xls and allow macros to run 2.) Accept MsgBox from ThisWorkbook.WorkBook_Open macro. 3.) That should be it. However, we have a second msgbox opening for ThisWorkbook.auto_open. This second one should not run (tested Excel 2010/2003).
Prior to Tomaž' patch, hasMacro could return true if sMod.isEmpty() and a Module named sMacroName has a "Main" macro. I think that might have been for MS Word's benefit. At least AutoOpen works that way (although our code didn't get the macroURL right). It is probably better that it doesn't return true, but just noting the difference.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ffc15725b58d0988b4e2ed836c5751223ad00984 tdf#148806 tdf#151393 xls vba: no Auto_Open from ThisWorksheet It will be available in 7.5.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.