Free Support Forum - aspose.com

How to add a named range using R1C1 formula's?

Hi,

In our application a lot of named ranges are created dynamically. Using MS Excel we could add them using a R1C1-formula defining the range. This doesn't seem to work using Aspose.

Example:

I use the following code to add the names:

pWorkbook.Worksheets.Names.Add("TestName")
pWorkbook.Worksheets.Names("TestName").RefersTo = "=Sheet1!R2C10"

When the resulting file is opened in MS Excel it shows in refers to as:

='Sheet1!R2C10'

Note the single quotes. If you open the dialog "Define Name" in Excel (CTRL + F3) and select this named range and click on OK, a message box shows stating the formula contains an error.

Is there another way to add named ranges using R1C1 notation (or a function that converts R1C1 formula's to 'normal' formula's)?

Thanks,

Timo

Hi Timo,

Yes, we found the issue as you have mentioned, we will fix it soon.

Thank you.

Hi,

Please try the attached version v4.8.0.8. We have supported adding a named range using R1C1 formula.See following code:

Workbook workbook = new Workbook();
workbook.Worksheets.Names.Add(“test”);
Name name = workbook.Worksheets.Names[0];
name.R1C1RefersTo = “=Sheet1!R2C10”;


Thank you.

Thanks, the fix works perfect!

The issues you have found earlier (filed as 10747) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.