Bug 145622 - Recording a Macro in Calc, not generating the proper code
Summary: Recording a Macro in Calc, not generating the proper code
Status: RESOLVED DUPLICATE of bug 147761
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.1.6.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-Recording
  Show dependency treegraph
 
Reported: 2021-11-10 23:10 UTC by Ron
Modified: 2022-03-21 14:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample macro and code (21.00 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-11-24 20:50 UTC, Ron
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ron 2021-11-10 23:10:54 UTC
Description:
I have created a macro to sort columns of numbers or letters many times with no issues. Now when I create the same macro and assign it to a button, it does not work. When I look at the code for the macro I notice it is missing a large number of args() lines.
Example of missings lines:  args3(0).Name="Byrows" args3(0).value=true ETC..
Completely mystified.  

Steps to Reproduce:
In Calc create a short list of Letters and Numbers in columns. Maybe 6 rows. Now RECORD a Macro to sort the LETTERS in ASCENDING order. And RECORD a macro to sort the NUMBERS in DECSENDING order. Create 2 buttons and assign the macros to the proper buttons. Once done, click the buttons and the letters or numbers should be sorted in proper order, basedon the assigned macro.

Actual Results:
THE MACROS DO NOT SORT THE ROWS.

Expected Results:
SORTED THE ROWS


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.1.6.2

IF YOU EDIT THE MACRO, YOU WILL SEE THE LINES ARGx(0).Name="Byrows" etc.. are missing. Also notice below the REM in front of the DISPATCHER line. ???? below

rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$4:$B$9"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())

rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, ".uno:DataSort", "", 0, Array())
Comment 1 Xisco Faulí 2021-11-23 10:10:30 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Comment 2 Ron 2021-11-24 20:50:40 UTC
Created attachment 176479 [details]
sample macro and code
Comment 3 Ron 2021-11-27 23:27:21 UTC
Today Nov 27
I ran the same exercise on my other Dell PC and got the same results
Ron G
Comment 4 Ron 2021-11-30 21:37:39 UTC
I uninstalled my Libreoffice 7.1.6.2 on my second computer and Installed version 7.0. The same macro worked FINE! No issues. Something must have been changed, or not activated or perhaps a setting is causing the issue in 7.1.6.2

Thanks for any help...Ron G
Comment 5 Ron 2021-12-08 03:59:18 UTC
I would like to make a comment about this Bug I have reported. This is a SERIOUS problem. Why? Because I designed a complete application for my local 8 ball league in Calc about 3-4 years ago, it worked fine. And this year when the League started up again there was a number of changes due to the League being shutdown for 2 years for COVID. 

This resulted in me having to adjust and RECREATE some of the macros and that's when I discovered the BUG. Luckily I didn't re-record all the MACROS. If I had this would have resulted in NOT being able to track stats, etc. for the League. It is too big a job to sort figures by hand with over a 100 players. And of course you guys being bogged down with so many reported bugs, that the response time is far too long for this type of issue. 

I would like this to be reported to the people WHO NEED TO KNOW. Thank you and I do appreciate the work you guys do.  Ron G
PS I downloaded version 7.1.8.1 and the problem still exists.
Comment 6 Timur 2022-03-18 14:58:34 UTC Comment hidden (obsolete)
Comment 7 Timur 2022-03-21 14:03:43 UTC
Working macro could be recorded using Data-Sort Ascending, but not using Data-Sort. That should be fixed in master 7.4+ in bug 147761.

*** This bug has been marked as a duplicate of bug 147761 ***