Bug 153724 - A macro which is executed in older versions but not in newer versions.
Summary: A macro which is executed in older versions but not in newer versions.
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.6.0 target:7.4.7 target:7.5....
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2023-02-19 04:06 UTC by Name
Modified: 2023-03-11 17:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A sample with the problematic macro (8.96 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-02-19 08:07 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Name 2023-02-19 04:06:21 UTC
Description:
newer versions refuses to execute almost all the macros.
In my poor investigation, 6.4 is fine but 7.3 or later has this problem.


sorry about my poor English.

Steps to Reproduce:
1. Use 7.4 or later [maybe 7.0 or later]
2. Run the macro which quoted in "Other Information" down below.
3. 6.4 does it fine but 7.4 or newer stops it with error. 

Actual Results:
It stops with error.

Expected Results:
I think this is a very big bug.
I need the macro so I uninstalled 7.4 and reinstalled 6.4 because newer versions refuses to execute the macro.


Reproducible: Always


User Profile Reset: No

Additional Info:
Sub さかさことば2()
    Dim 選択セル As Range
    For Each 選択セル In Selection
    選択セル.Value = StrReverse(選択セル.Value)
    Next 選択セル
End Sub



3行マクロ~文字列をさかさに並び替える、文字列逆から読む~StrReverse 関数
https://kokodane.com/mini_macro28.htm
Comment 1 Mike Kaganski 2023-02-19 08:07:57 UTC
Created attachment 185469 [details]
A sample with the problematic macro

Repro. The attachment contains the VBA macro. Select the cells with strings, and try to execute it. The error is "'13' Data type mismatch." at line 5:

> For Each 選択セル In Selection

It works fine in 6.4.0.3.
Comment 2 Mike Kaganski 2023-02-19 09:41:56 UTC
Regression after commit 5760c94b8847164f9a7a181f031c7c86643944af.
Comment 3 Name 2023-02-19 10:31:59 UTC
Thank you so much.
I wonder it works in 6.4.7.2 but comes with error in current versions, anyway.
I hope that my report will help improving Libreoffice even just a little.
Comment 4 Mike Kaganski 2023-02-19 11:26:12 UTC
https://gerrit.libreoffice.org/c/core/+/147273
Comment 5 Commit Notification 2023-02-19 13:37:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fd6a0cf1eb8441acb23f22e9e9fafc477bf4e57e

tdf#153724: make sure to retrieve the variable value before checking the type

It will be available in 7.6.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.
Comment 6 Commit Notification 2023-02-20 07:52:15 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/acd44070a5fae1bbeec063acc8a68463d914529d

tdf#153724: make sure to retrieve the variable value before checking the type

It will be available in 7.4.7.

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.
Comment 7 Commit Notification 2023-02-20 07:52:18 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/bcd6333952d4d1fe2bbe1c08616f8210ee0d3f7e

tdf#153724: make sure to retrieve the variable value before checking the type

It will be available in 7.5.2.

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.
Comment 8 Commit Notification 2023-02-20 17:05:22 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-6":

https://git.libreoffice.org/core/commit/ef029c7eb79f6d696e6afeb07456cae3fceaf51e

tdf#153724: make sure to retrieve the variable value before checking the type

It will be available in 7.4.6.

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.
Comment 9 Name 2023-02-21 09:43:39 UTC
(In reply to Commit Notification from comment #7)
> Mike Kaganski committed a patch related to this issue.
> It has been pushed to "libreoffice-7-5":
> 
> https://git.libreoffice.org/core/commit/
> bcd6333952d4d1fe2bbe1c08616f8210ee0d3f7e
> 
> tdf#153724: make sure to retrieve the variable value before checking the type
> 
> It will be available in 7.5.2.
> 
> 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.

I downloaded from https://dev-builds.libreoffice.org/daily/libreoffice-7-5/Linux-rpm_deb-x86_64@tb87-TDF/2023-02-21_01.55.40/LibreOfficeDev_7.5.2.0.0_Linux_x86-64_deb.tar.gz and installed it.

Now the problematic macro works fine down below.
It is fixed by those great technicians.
I thank Dr. Kaganski so much especially.
He has done so fast and finished in 1 day.
  
Option VBASupport 1
REM  *****  BASIC  *****
 Sub さかさことば2()
    Dim 選択セル As Range
    For Each 選択セル In Selection
    選択セル.Value = StrReverse(選択セル.Value)
    Next 選択セル
End Sub

If this comment is not needed, please delete this.
Comment 10 Commit Notification 2023-02-22 10:14:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-1":

https://git.libreoffice.org/core/commit/1ef9c47bdd357157979412c99e1412eeb4777e1f

tdf#153724: make sure to retrieve the variable value before checking the type

It will be available in 7.5.1.

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.