Created attachment 135092 [details] Calc file with macros I use for the first time a macro defined in Excel 2007. The macro crash on the following line iCount = ActiveChart.SeriesCollection.Count with the following error's message translated from french BASIC Execution Error '91' Object variable not defined. I have replaced iCount = ... by iCount = 0 and the line is executed, so that I'm pretty sure that the problem is caused by the expression ActiveChart. I have tried to use IMMEDIATE Window on LibreOffice but I don't find it on LibreOffice !!! I have attached my original file without personal DATA. The macro is started in calling "ComputeTableMensuelle" and crash when line iCount = ... is executed in CleqrChqrt() function. '************************************************************************* '* ClearChart '************************************************************************* Sub ClearChart() Sheets(xSheet + 1).Select Application.ScreenUpdating = False 'ActiveSheet.ChartObjects(1).Activate iCount = ActiveChart.SeriesCollection.Count Do While iCount > 1 ActiveChart.SeriesCollection(2).Delete iCount = iCount - 1 Loop Sheets(xSheet + 2).Select Application.ScreenUpdating = False 'ActiveSheet.ChartObjects(1).Activate iCount = ActiveChart.SeriesCollection.Count Do While iCount > 1 ActiveChart.SeriesCollection(2).Delete iCount = iCount - 1 Loop Sheets(1).Select End Sub
Hello schlebe, Could you please share the steps to run the macro? Every time I try to run it I get: BASIC runtime error. Sub-procedure or function procedure not defined.
Hello Xisco, I have downloaded the attachment posted by me to be in same situation that you. Then to start the macro, I click on 1. Tools\Macros\Execute menu 2. a tree with 3 possiblitlies is displayed 3. I open the node ReleveCompteurs.ELECTRICITE.forLO.xlsm 3. I open the node VBA project 4. I double click on node "Module1" 5. I double click on ComputeTableMensuelle macro in right panel ... and the macro run and crash. I hope that than can help you. Bye
I can reproduce it in Versión: 5.4.0.3 Id. de compilación: 7556cbc6811c9d992f4064ab9287069087d7f62c Subproc. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; Configuración regional: es-ES (es_ES); Calc: group but not in Version: 6.0.0.0.alpha0+ Build ID: 1e87e93132f808ab95eab932b36bfe40d3cc607a CPU threads: 1; OS: Windows 6.1; UI render: default; TinderBox: Win-x86@39, Branch:master, Time: 2017-07-25_06:09:29 Locale: es-ES (es_ES); Calc: group Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ? You can install it alongside the standard version. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
I have installed last version 6.0.0.0.alpha0+ and I have tested the macro with sheet 1 filled with correct values. The program doesn't crash ... it is OK ... BUT the program doesn't fill correctly the cells in others sheets like it make on Excel. For each sheet after first sheet, the program create a sheet with 2 tables and a sheet with a Chart representing these 2 tables. For each sheet with 2 tables, the program 1. clear the column representing the data of year 2017 2. fill the column of year 2017 When I analyze the result, I can see that the 2017 columns seems to be cleaned BUT the 2017 column are always EMPTY. When I try to Debug the program to give you more information ... the program crash ... no chance. So I think (but I'm not sure) that the 6 alpha version recognize the ActiveChart object but for unknown reasons doesn't make correctly the following actions because the 2017 columns are all emtpy.
(In reply to schlebe from comment #4) > I have installed last version 6.0.0.0.alpha0+ and I have tested the macro > with sheet 1 filled with correct values. > > The program doesn't crash ... it is OK > > ... BUT the program doesn't fill correctly the cells in others sheets like > it make on Excel. > > For each sheet after first sheet, the program create a sheet with 2 tables > and a sheet with a Chart representing these 2 tables. > > For each sheet with 2 tables, the program > 1. clear the column representing the data of year 2017 > 2. fill the column of year 2017 > > When I analyze the result, I can see that the 2017 columns seems to be > cleaned > > BUT the 2017 column are always EMPTY. > > When I try to Debug the program to give you more information ... the program > crash ... no chance. > > So I think (but I'm not sure) that the 6 alpha version recognize the > ActiveChart object but for unknown reasons doesn't make correctly the > following actions because the 2017 columns are all emtpy. Closing as RESOLVED WORKSFORME then. Please report another issue for the cells not filled
Hello, I can reproduce this bug on Windows 7 with LO 6.0.6.2 (x64). In fact there are 4 bugs in this example: To reproduce execute sub ComputeTableSolaire() in Module1 of the VBAProject. a) It seems that ActiveChart is not implemented at all (423 runtime error). b) In sheet "Graphics Solaire" the graph is an object but in sheet "Cumul Solaire" the graph is really a graph. You can see it in the object navigator. If I insert a graph in the sheet "Graphics Solaire" with the menu Insert > Graph..., an object is inserted, not a graph. ChartObjects.Count return 0 on sheet "Graphics Solaire" and 1 on sheet "Cumul Solaire". c) The name property on a Chart object return an empty string. d) An chart object has a SeriesCollection collection but using it raise an 91 runtime error. Regards, -- Stéphane Aulery
Created attachment 146137 [details] debug_document_2.xlsm
debug_document_2.xlsm is a minimal example of the four bugs.
Hello Stéphane Aulery, the original report was about a crash, which is no longer reproducible in 6.0.0.0.alpha0+ as mentioned in comment 4. Please, report the problems mentioned in comment 6 in a new bug -> https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice&format=guided Closing as RESOLVED WORKSFORME
*** Bug 152604 has been marked as a duplicate of this bug. ***