LR
Lokesh R
Syncfusion Team
July 28, 2010 05:56 AM UTC
Hi Benoit,
Thank you very much for your interest on Syncfusion products.
I have analyzed the two queries posted in your last update and given below the details in separate headings.
sheet.Names("CellName").Value:
The Value property associated with the INames will return only the A-1 style notation of the referred range which we represent in the macros without a "=" sign. If you have to retrieve a value of the named range you need to use the below code snippet instead of the above.
[C#]
sheet.Names["Test"].ReferToRange.Value;
Named cell exist without crashing:
you can read all the named cells by iterating the INames collections. I have given below the code snippet for the same.
[C#]
foreach (IName namedCell in wkBook.Names)
{
if (namedCell.Name == "Test")
{
System.Console.WriteLine(namedCell.RefersToRange.Value);
}
}
[VB]
For Each namedCell As IName In wkBook.Names
If namedCell.Name = "Test" Then
System.Console.WriteLine(namedCell.RefersToRange.Value)
End If
Next namedCell
Please, let us know if you need any clarifications.
Thanks,
Lokesh.