probst
probst

Reputation: 346

Convert string to Aspose.Cells.Name

I am trying to check, if the name of the sheet already is in the other workbook. I am currently trying it like this:

if (tempWb.Worksheets.Names.Contains(ibbWs.Worksheets[index].Name))
{
...
}

How can I fix that or convert a string into a Aspose.Cells.Name object?

Upvotes: -1

Views: 127

Answers (1)

Amjad Sahi
Amjad Sahi

Reputation: 1931

You may simply check whether a given Name is null or not, so you may write your own code accordingly for your needs. See the sample code segment for your reference: e.g

Sample code:

------------
Name name = workbook.Worksheets.Names["yournamestring"];
if (name == null)
                    Debug.WriteLine("Not found");
                else
                    Debug.WriteLine("found" );
                    //...........Your code goes here.
  -------

PS. I am working as Support developer/ Evangelist at Aspose.

Upvotes: 1

Related Questions