Description: Option VBASupport 1 Option Compatible Option explicit Sub test Dim BasisDateiName As string Dim DateiName As String Dim PfadName As String Dim PfadDateiName As String BasisDateiName="WM_ImmobilienService.ods" DateiName ="Test.xlsx" PfadName="/home/harald/Dokumente/WM_ImmobilienService/Auftrag/" 'Neue AuftragsMappe erstellen PfadDateiName = PfadName & DateiName 'On Error Resume Next Workbooks(BasisDatei_Name).Worksheets(Array("Auftrag","Nachweis")).Copy ActiveWorkbook.SaveAs filename:=PfadDateiName 'on error goto 0 End Sub Workbooks(BasisDatei_Name).Worksheets(Array("Auftrag","Nachweis")).Copy definitly works correctly but throws error com.sun.star.container.NoSuchElementException With On error resume next i can force it to do the expected work like MS-excel Since last update it does only the first sheet Steps to Reproduce: run it Actual Results: not usable any more Expected Results: should work as in MS excel without error message !!! Reproducible: Always User Profile Reset: Yes OpenGL enabled: Yes Additional Info: [Information automatically included from LibreOffice] Locale: de Module: SpreadsheetDocument [Information guessed from browser] OS: Linux (All) OS is 64bit: yes
source code pointer: https://opengrok.libreoffice.org/xref/core/sc/source/ui/vba/vbaworksheets.cxx?r=bb06f513#443 https://opengrok.libreoffice.org/xref/core/sc/source/ui/vba/vbaworkbook.cxx?r=0c1b4904#237 https://opengrok.libreoffice.org/xref/core/sc/source/ui/vba/vbaworksheet.cxx?r=85b40048#553 currently ScVbaWorksheets does not have Copy method etc., ScVbaWorksheet does. Aside from this main point, we have to be careful of the following two points. 1. VbaWorksheets nor ScVbaWorksheet has SaveAs method. 2. THIS METHOD HAS A BUG: see Bug 118146 https://bugs.documentfoundation.org/show_bug.cgi?id=118146
typo: wrong : VbaWorksheets nor ScVbaWorksheet has SaveAs method. correct :neither ScVbaWorksheets nor ScVbaWorksheet has SaveAs method. ScVbaWorkbook does.
copy without a target has destination activeworkbook and activeworkbbok has as method .saveas this is an example from microsoft Worksheets(Array("Sheet1", "Sheet2", "Sheet4")).Copy With ActiveWorkbook .SaveAs Filename:=Environ("TEMP") & "\New3.xlsx", FileFormat:=xlOpenXMLWorkbook .Close SaveChanges:=False End With in open office with option VBASupport on this is also possible, but an error is generated and the last page in the array disappears from the new workbook. That's what i'm talking about. if I use on error resume next everything is working as expected!!
> activeworkbook has as method .saveas sorry, I missed this one.
Created attachment 185359 [details] Example file based on comment 3 I tried to reproduce this issue based on the example code in comment #3 but this seems to work in 6.4.0, 7.0.0, and current master. All 3 sheets are present in the exported file.
Could you please create an example file that shows the problem? I tried to use the code in the Description, but can't get that one working.
Dear Harald Langheinrich, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Dear Harald Langheinrich, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-FollowUp