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: 4.2.2.1 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-14 15:05 UTC by Alejandro Moreno
Modified: 2014-08-25 15:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


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

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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.