Bug 63984

Summary: Macro does not trigger automatically
Product: LibreOffice Reporter: Ahamed <ahamedckmgm>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: trivial CC: jmadero.dev
Priority: medium    
Version: 4.0.0.3 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: the file contains the macro namely "MinimumDutyDays"

Description Ahamed 2013-04-27 05:29:45 UTC
Created attachment 78541 [details]
the file contains the macro namely "MinimumDutyDays"

While trying to automate one cell (here D15) the macro does not run automatically. The cell value should not be a negative value.
The cell value is computed from other cells automatically based on an equation. When the cell value is changed my macro should trigger and check whether the cell value is negative then the causing cell values should be made to the default value of zero with a warning message

The macro and the file as such is attached herewith

Please help me

I am using Ubuntu 10.4 with LiberOffice 4.0

Ahamed
Comment 1 Joel Madero 2013-04-30 22:31:09 UTC
Hm, how are you making a macro automatically trigger when a cell changes?
Comment 2 Joel Madero 2013-05-01 03:27:19 UTC
Marking as NEEDINFO - 

It is unclear whether you are reporting a bug or asking for help to make your macro work.

So a few questions:

1. Are you reporting a bug or asking for someone to help you with your macro? For the second issue I recommend going to user mailing list, #libreoffice (on freenode IRC) or our ask site.

If (and only if) you are reporting a bug -

What value do I change to see what the macro should be doing?

Did this work in 3.6 series or has it EVER worked?

Please answer these, if this is indeed a bug and you can answer these questions, mark as UNCONFIRMED and we will check it out.
Comment 3 Ahamed 2013-05-03 09:47:35 UTC
(In reply to comment #1)
> Hm, how are you making a macro automatically trigger when a cell changes?

Earlier I had made a macro of similar nature and it works well even now for a change in  value in a particular cell and the macro does what I intended with a piece of code.  But here, when the sub main is forced to run once,  ie. Tools--> Macros-->Run macro... and then selecting the sub main under this file.... 

ONCE it is run,  there after when the cell value is changed the listener clearly listens and does the necessary actions depicted by the code.  What I feel is that, it is not listening initially even when we change the value of the particular cell (here, D15) by changing the value of the dependent cells such as C16, C18 and C19, etc.which forms part of the formula.  But as I said, ONCE it is forcibly triggered, the event is triggered there after.

I suspect this is a bug.  You can please do the following to repeat the actions,

1. start the application by double clicking the file name
(ie. it will open the LO 4.0, select Enable Macros .. while on opening the file)
2. change the value in either or all of the cells C16, C18 and C19 (large values such that the D15 value become -ve.) which will eventually change the value of cell D15.( as the cell D15 is dependent on these cells) 
 ---- Now, the macro does not do any thing and does not run and nothing happens 
3. click on Tools-->Macros-->RunMacro...
select from the Dialog,
Under Library, select the Module Name "MinimumDutyDays" under the file name and 
select the macro, "Main"
4.Now, repeat the 2nd step by changing the values in cells C16.... to a large value such that the D15 value become -ve.  Now, we can see that the macro automatically runs and get the desired output.

My doubt is that why the macro does not trigger automatically initially and the registered listener on cell D15 does not trigger the macro when value of the cell changes.

If it is a general behaviour and not a bug please tell me how to do this activity using  a macro
I hope the aforementioned explanation is clear,

Rasheed
Comment 4 Ahamed 2013-05-03 09:53:13 UTC
UNCONFIRMED
Comment 5 Ahamed 2013-05-04 03:19:00 UTC
I got the solution from the site
http://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=61426&p=272316#p272316
and I think this can be termed as SOLVED
or else the feature can be included in the next release...........



Rasheed
Comment 6 Owen Genat (retired) 2013-05-27 07:38:43 UTC
Related AskLO thread is:

http://ask.libreoffice.org/en/question/16648/macro-does-not-trigger-automatically/

I am setting this bug RESOLVED as NOTABUG.