List Info

Thread: Problen on insert rows




Problen on insert rows
user name
2007-02-04 11:32:26
Hi,

inserting rows with insert metod seems having ungrateful
effects on 
formula positioned in under part cells.

A simple example...

in calc table write:

at cell B11: 1
at cell B12: 2
at cell B13: 3
and in cell B10: =SUM(B11:B13)

and execute this code:

Sub Main
osheet=ThisComponent.sheets.getByName(_
ThisComponent.currentController.activesheet.name)
oSheet.Rows.InsertByIndex(8.3)
end sub

Changing the values of "position row" and
"inserting rows nunber" return 
unexpected result in B10 formula... (you can easily to
try...)

Is it normal?

Any idea for workaround?

thanks

Bart

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Problen on insert rows
user name
2007-02-04 12:10:22

Bart Aimar ha scritto:
> zot... 
> Changing the values of "position row" and
"inserting rows nunber" return 
> unexpected result in B10 formula... (you can easily to
try...)


Es:
(7,3) no problems
(8,2) no problems
(2,8) no problems

otherwise:
(2,9) return error in formula
like (7,5)
and any combination where the sum of two paramters give e
number higher 
than the row number where reside the formula...

??

Bart

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Problen on insert rows
country flaguser name
Australia
2007-02-04 16:01:55
On 05/02/2007, at 4:32 AM, Bart Aimar wrote:

> Hi,
>
> inserting rows with insert metod seems having
ungrateful effects on  
> formula positioned in under part cells.
>
> A simple example...
>
> in calc table write:
>
> at cell B11: 1
> at cell B12: 2
> at cell B13: 3
> and in cell B10: =SUM(B11:B13)
>
> and execute this code:
>
> Sub Main
> osheet=ThisComponent.sheets.getByName(_
> ThisComponent.currentController.activesheet.name)
> oSheet.Rows.InsertByIndex(8.3)
> end sub
>
> Changing the values of "position row" and
"inserting rows nunber"  
> return unexpected result in B10 formula... (you can
easily to try...)
>
> Is it normal?
>

Bart,

It appears this is "normal".

Please look at menu Tools - Options - OpenOffice.org Calc -
General
Look at checkbox in Input  Settings - "Expand
references when new  
column/rows are inserted"

I was able to reproduce the error you described, only if
this box is  
checked. In that case the first cell address in the SUM
range is not  
changed, so that sometimes the sum formula cell will end up
inside  
the formula range, which is an error.   There is more
discussion  
about this in the Help.

Jim

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Problen on insert rows
user name
2007-02-04 16:45:02
2007/2/4, Bart Aimar <b_aimarfastwebnet.it>:
>
> Hi,
>
> inserting rows with insert metod seems having
ungrateful effects on
> formula positioned in under part cells.
>
> A simple example...
>
> in calc table write:
>
> at cell B11: 1
> at cell B12: 2
> at cell B13: 3
> and in cell B10: =SUM(B11:B13)
>
> and execute this code:
>
> Sub Main
> osheet=ThisComponent.sheets.getByName(_
> ThisComponent.currentController.activesheet.name)
> oSheet.Rows.InsertByIndex(8.3)
> end sub
>
> Changing the values of "position row" and
"inserting rows nunber" return
> unexpected result in B10 formula... (you can easily to
try...)
>
> Is it normal?
>
> Any idea for workaround?
>
> thanks
>
> Bart
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
>
>
My workaround is to not insert rows but rather move
everything below a row
one step down, but now I am talking about doing it manually,
without a
macro.

And I just read that someone here might have delivered a
better answer for
you.

Johnny Andersson
Re: Problen on insert rows
user name
2007-02-05 03:27:10

Jim Watson ha scritto:
>...zot
> Please look at menu Tools - Options - OpenOffice.org
Calc - General
> Look at checkbox in Input  Settings - "Expand
references when new 
> column/rows are inserted"
> 
> I was able to reproduce the error you described, only
if this box is 
> checked. In that case the first cell address in the SUM
range is not 
> changed, so that sometimes the sum formula cell will
end up inside the 
> formula range, which is an error.   

Thank you Jim... problem solved!



Bart

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: Problen on insert rows
user name
2007-02-05 03:56:07

Johnny Andersson ha scritto:
>
> ...zot...

> And I just read that someone here might have delivered
a better answer for
> you.

Yes! A resolving answer! 

thank's

Bart

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )