Created attachment 43853 [details] The complete macro code. I have written a rather pleasing little macro in excel, which works fine in Windows/MSoffice. It doesn't run in Libreoffice/calc. I can step through the code with the debugger, and it is the copy method in the code below that causes the problem: i = Sheets.Count Sheets(Array("Specimen data", "Specimen pu", "Specimen eng.")).Copy After:= _ Sheets(i) Executing this line causes a dialogue which says BASIC runtime error. '423' Copy The help says that 423 means "423 Property or method not found" so I assume you have not yet implemented sheets(index).copy I thought this bug report might help improve the next generation. (The macro in full is attached for reference. I had to set the lowest security level to run it at all)
Created attachment 43857 [details] recorded macro to copy three sheets. Just for grins, I tried it in windows with LibreOffice 3.3.1. The error message was rather more baffling: BASIC runtime error '1' Type:com.sun.star.uno.RuntimeException Message:[mcsi_uno bride error] UNO type of C++ exception unknown:"std.__non_rti_object",RTTI-name=".?AV__non_rtti_object@std@"! I can't tell you what the runtime error 1 means in windows, because een though I have installed the help page download, the programme insists on going to the web, where it says "Sbasic/start" has no text. Fur further grins I have recorded a macro using calc to do the same thing, copy three sheets, and I have to say that the syntax of what I got back (attached, LibreOffice3_macro.txt) is rather non-obvious compared to what I was working with in MSoffice. I can't see any way to write code portable between the two.
make this into an easy hack, details http://wiki.documentfoundation.org/Development/Easy_Hacks#VBA_support_add_support_for_Worksheets.Copy hopefully someone will pick this up. regarding the output from the libreoffice macro recorder we don't recommend using that at all ( I thought in fact it was disabled by default )
@Noel Power: Thanks for escalating that. Much Appreciated. One thing that is of importance in the excel implementation is that relative addressing is preserved during the copy process. If, for example, a cell or a graph in sheet2 references sheet1, performing a copy of two sheets means that the cell or graph in sheet4 ends up referencing sheet3 - not the original sheet. And, yes, I had to turn the macro recorder on in order to fiddle with it.
fixed in LibreOffice 3.4 by commit f96c5afd276287d896760e11542918e679069b8c