Issue 31627 - cannot setvalue through calc function when target cell is on same sheet as function
Summary: cannot setvalue through calc function when target cell is on same sheet as fu...
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC All
: P3 Trivial
Target Milestone: ---
Assignee: niklas.nebel
QA Contact: issues@api
Depends on:
Reported: 2004-07-17 11:45 UTC by raabun
Modified: 2013-02-24 21:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

bugdoc (6.77 KB, application/vnd.sun.xml.calc)
2004-07-21 09:55 UTC, chne
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description raabun 2004-07-17 11:45:19 UTC
I think my problem sounds silly. My function, schicht_type, is called by a cell
on sheet 0:

FUNCTION schicht_type(pointer AS INTEGER, enable AS INTEGER) AS DOUBLE
Dim sheet AS OBJECT

MyDoc = ThisComponent
sheet = MyDoc.getSheets().getByIndex(0)


this function is called by a cell on sheet 0


everything works, but not these 2 rows

sheet = MyDoc.getSheets().getByIndex(0)

if I change them

sheet = MyDoc.getSheets().getByIndex(1)

everything is ok

I also tried to change the .getByIndex(0) to .getByName("Tabelle1") but it was
the same. I'm using the german version of OOo 1.1.1

I hope I'm not telling rubbish, but checked several forums etc.
Thanks a lot
Comment 1 frank 2004-07-19 10:49:03 UTC
Hi Christoph,

could you have a look please ?

Comment 2 chne 2004-07-21 09:55:05 UTC
cn->nn: I've attached a bugdoc. This doc contains a small macro. If you call the
function myfunc with parameter 0;0;9 (sheet_index; col; row) on sheet 0 I expect
to see the value 10 on cell 0;9 of sheet 0. But nothig happens. If you call the
function with parameter (1;0;9) you will see the value 10 on sheet 1 in cell 0;9.
Comment 3 chne 2004-07-21 09:55:59 UTC
Created attachment 16646 [details]
Comment 4 niklas.nebel 2004-07-21 13:03:15 UTC
That's on purpose. A function that is used in a cell formula may be called
during repaint of the sheet, to get the formula's result, and cannot modify that
sheet. If you want to modify cells, don't call the function from a formula.
Comment 5 ooo 2004-08-03 09:00:40 UTC