excel 2002 does not re-evaluate value written in range

Hi,

i set the value of a named cell, using this piece of code:

IRange r = namedCell.RefersToRange;
r.Value = "test";

other cells in the excel sheet refers to the named cell using formulas like "=namedcell", if i open that excel 2003 file with version 2003 these cells display value "test", if i open it with excel 2002 cells are not updated.

Do you know why? Where am I wrong?

3 Replies

BR Balamurugan R Syncfusion Team December 11, 2009 11:02 AM UTC

Hi Netical,
Thankyou for interest in Syncfusion products
I am unable to reproduce the issue.Please use this code for setting the value for the named range.

C#:

IName lname1 = workbook.Names.Add("NamedCell");

lname1.RefersToRange = sheet.Range["A1:G9"];

sheet.Range["NamedCell"].Value = "test";

Please,let us know if u have any queries.

Regards,
Balamurugan.


NE Netical December 15, 2009 08:36 AM UTC

Hi Balamurugan, thank you for your help but, your solution fails because namedcell.value contains the 'address' of the named cell like 'sheet1!&B&1'.

If I try to write in it, for example "test", I get an error that says "test is not a valid range".

Ah, I forget to tell you that I'm not creating new named cell by my application code but I am referincing the ones that has already been created by hand using excel application.


BR Balamurugan R Syncfusion Team December 16, 2009 04:44 AM UTC

Hi Netical,

I have analysied your problem and find out the solution for your request.I have opened a Excel sheet and set a range of cells with the name "NamedCell",after that i have used the name "NamedCell" to set the range using XlsIO.I have given the
code snippt below.

IRange r=sheet.Range["NamedCell"];
r.Value="test";

Please,let us know if you have any queries,

Regards,
Balamurugan.

Loader.
Up arrow icon