Description: Using LibreOffice Calc, a round trip from .xls to .ods to .xls doesn't work for a Excel spreadsheet with a simple button which runs a subroutine that shows a message box. Steps to Reproduce: An Excel button2macro.xls spreadsheet file with a button that runs macro MsgBox "Hello World!" With LibreOffice Calc, save the button2macro.xls file as button2macro.ods. Clicking the "Button 1" shows the "Hello World!" dialog box. Close LibreOffice. With LibreOffice Calc, save the button2macro.ods file as button2macroback.xls. Open the button2macroback.xls with Microsoft Excel 2010 and a dialog shows with a message: ``` Office has detected a problem with this file. To help protect your computer this file cannot be opened. ``` LibreOffice Calc 7.3.4.2 opens the button2macroback.xls file and it works most of the time; however, there was a time when the file opened and the button was clicked and it didn't work with the message: ``` A Scripting Framework error occurred while running the UNKNOWN script UNKNOWN. Message: Incorrecct format for Script URI: /run/build/libreoffice/scripting/source/provider/MasterScriptProvider.css:238 ``` Perhaps the MasterScriptProvider.css:238 can help with finding a solution so a round trip of a VBA file is achievable. Actual Results: Open the button2macroback.xls with Microsoft Excel 2010 and a dialog shows with a message: ``` Office has detected a problem with this file. To help protect your computer this file cannot be opened. ``` Expected Results: The button2macroback.xls spreadsheet file should be able to be opened with Microsoft Excel 2010. Reproducible: Always User Profile Reset: No Additional Info: The Excel button2macro.xls spreadsheet file will be attached as later as unsure how to attach it now. Will help with bug 149325. Thank you
Created attachment 180746 [details] button2macro.xls
Created attachment 180747 [details] button2macro.ods
Created attachment 180748 [details] button2macroback.xls
I confirm with office.com Arch Linux 64-bit, X11 Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 4c06cfcd13195e9e996bc09dbee2dcac1c5e8ed2 CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 20 January 2023 (In reply to Óvári from comment #0) > ``` > A Scripting Framework error occurred while running the UNKNOWN script > UNKNOWN. > > Message: Incorrecct format for Script URI: > /run/build/libreoffice/scripting/source/provider/MasterScriptProvider.css:238 > ``` The code block is: // need to get the language from the string Reference< uri::XUriReferenceFactory > xFac ( uri::UriReferenceFactory::create( m_xContext ) ); Reference< uri::XUriReference > uriRef = xFac->parse( scriptURI ); Reference < uri::XVndSunStarScriptUrl > sfUri( uriRef, UNO_QUERY ); if ( !uriRef.is() || !sfUri.is() ) { throw provider::ScriptFrameworkErrorException( "Incorrect format for Script URI: " + scriptURI, Reference< XInterface >(), scriptURI, "", provider::ScriptFrameworkErrorType::UNKNOWN ); }