Created attachment 142930 [details] Example file from Excel If we try to run this simple “open file dialog” macro in LibreOffice Calc, which is in the attached file, we got an error code('423' GetOpenFilename). The main reason of this error is that LibreOffice uses another File selection dialog method: CreateUnoService("com.sun.star.ui.dialogs.FilePicker") Steps to reproduce: 1. Create a new spreadsheet with Microsoft Excel 2016/2013 2. Open the Visual Basic window 3. Add a new Module to your VBAProject 4. Use this simple code: Sub getFileName() Dim filename As String filename = Application.GetOpenFilename() MsgBox filename End Sub 5. Save the file as *.xlsm 7. Open the file with LibreOffice Calc. Run the macro. Actual results: The file dialog is opened in Microsoft Office Excel, but If We use this “GetOpenFilename” method in LibreOffice Calc, we get an error message. If we use the LibreOffice module CreateUnoService("com.sun.star.ui.dialogs.FilePicker") we don’t gt an error message. Expected results: We should not get an error message if we use the “GetOpenFilename” method. Version: 6.0.0.0.beta1+ Build ID: 29228e83df009cf76ac819ed024527be1092f065 CPU threads: 4; OS: Windows 6.1; UI render: default; TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2017-12-04_23:15:34 Locale: hu-HU (hu_HU); Calc: group threaded
Created attachment 142931 [details] The macro in Excel and Calc side by side
The problem is not in FilePicker. the responsibility is on ScVbaApplication. This class currently does not have GetOpenFilename() method. https://opengrok.libreoffice.org/more/core/sc/source/ui/vba/vbaapplication.cxx?q=ScVbaApplication
NEW per comment 2
Documentation about GetOpenFilename() method is available at: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/application-getopenfilename-method-excel There is also missing implementation of GetSaveAsFilename() Method: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/application-getsaveasfilename-method-excel Example of implemented Goto method is available at: https://opengrok.libreoffice.org/xref/core/sc/source/ui/vba/vbaapplication.cxx#597 The documentation: https://msdn.microsoft.com/en-us/vba/excel-vba/articles/application-goto-method-excel
*** Bug 126750 has been marked as a duplicate of this bug. ***
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/571438a34ad9aba0d496a89e8345851331740fbd tdf#118246 add support for Application.GetOpenFilename func. It will be available in 7.4.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.
Is this fixed now?