Bug 77437 - Macros: VBA loop While ActiveCell <> "" don't work on Libreoffice
Summary: Macros: VBA loop While ActiveCell <> "" don't work on Libreoffice
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: Macro-VBA
  Show dependency treegraph
 
Reported: 2014-04-14 15:05 UTC by Alejandro Moreno
Modified: 2024-11-29 03:12 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Excel with a loop do with While ActiveCell <> "" (38.81 KB, application/vnd.ms-excel.sheet.macroenabled.12)
2014-04-14 15:05 UTC, Alejandro Moreno
Details
Example with macro loop. (14.50 KB, application/vnd.ms-excel)
2014-04-16 15:33 UTC, Alejandro Moreno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro Moreno 2014-04-14 15:05:54 UTC
Created attachment 97354 [details]
Excel with a loop do with While ActiveCell <> ""

If you have a VBA macro with a loop with code similar to

Range("A1").Select
While ActiveCell <> ""
    'some code
Wend

Libreoffice don't in into the While loop.

I attached a excel with a button with text "First free cell". In Excel this button return a message with result 22. On Libreoffice this button not to do anything.
              
Operating System: All
Version: 4.2.2.1 release
Comment 1 Julien Nabet 2014-04-14 19:27:29 UTC
Once Security is set to "Medium", I tried to click the button, nothing.
Then I tried to "Tools/Macros/Run macro, selected VBA Project/Modulo1/Boton1 and it worked.
It looks like the button has no macro assigned.
Comment 2 Alejandro Moreno 2014-04-16 08:08:06 UTC
(In reply to comment #1)
> Once Security is set to "Medium", I tried to click the button, nothing.
> Then I tried to "Tools/Macros/Run macro, selected VBA Project/Modulo1/Boton1
> and it worked.
> It looks like the button has no macro assigned.

I do the same and it works but there is another error. If you click the button "Fila libre" it return alternately 8 and 15 when the correct answer is 14.
Comment 3 Alejandro Moreno 2014-04-16 15:33:29 UTC
Created attachment 97477 [details]
Example with macro loop.

I add a new example loop that don't work in Libreoffice calc.

The code contain a loop:

Range("c2").Select
While ActiveCell <> ""
    If parent = ActiveCell.Value Then
        check = check + 1
    End If
    ActiveCell.Offset(1, 0).Select
Wend

but the Libreoffice don't in into the while and check is always 0.
Comment 4 raal 2014-08-25 15:04:49 UTC
I can confirm with Version: 4.3.2.0.0+
Build ID: 25459cb0c9afdf46c3d90ae8ba0b6ffb375f67da
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-3, Time: 2014-08-17_22:48:01

Version: 4.4.0.0.alpha0+
Build ID: 30ae83c268125383866d47a7ee3e4a5dfcf59f71
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-08-23_22:03:46

BUT weird thing is that this macro works in first run:
 - open file
 - open IDE
 - run macro in step-by-step F8
 - While ActiveCell <> ""   -> works
 - run macro again
 - While ActiveCell <> ""  -> don't work
Comment 5 Alejandro Moreno 2015-07-27 16:08:31 UTC
Bug is still in Version: 5.0.0.4.

First time works OK but it's like command Select doesn't work OK at second time.
Comment 6 QA Administrators 2016-09-20 10:18:11 UTC Comment hidden (obsolete)
Comment 7 Alejandro Moreno 2016-09-20 11:57:39 UTC
Bug is still in Version: 5.2.1.2.

First time works OK but it's like command Select doesn't work OK at second time.
Comment 8 Xisco Faulí 2017-09-29 08:52:15 UTC Comment hidden (obsolete)
Comment 9 Alejandro Moreno 2017-10-02 15:21:31 UTC
Bug is still in Version: 5.4.1.2
Comment 10 QA Administrators 2018-10-03 02:53:56 UTC Comment hidden (obsolete)
Comment 11 Alejandro Moreno 2018-11-07 10:17:19 UTC
Same test that in #4 still don't work with
Versión: 6.1.2.1
Id. de compilación: 65905a128db06ba48db947242809d14d3f9a93fe
Subprocs. CPU: 4; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-AR (es_ES); Calc: group threaded
Comment 12 himajin100000 2019-08-20 08:27:23 UTC
When I run 

Option VBASupport 1
Option Explicit
Sub Main
	Dim x As Object
	Set x = ActiveCell
End Sub

and added the variable x to the watch window(or observer),

the type of the property "Value" was Variant/Empty
Comment 13 QA Administrators 2021-08-21 03:50:41 UTC Comment hidden (obsolete)
Comment 14 Alejandro Moreno 2022-11-29 15:32:20 UTC
Same test that in #4 still don't work with
Version: 7.4.3.2 (x64) / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: threaded
Comment 15 QA Administrators 2024-11-29 03:12:26 UTC
Dear Alejandro Moreno,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug