Free Support Forum -

Does something exist in aspose.Cells like "ActiveWorkbook.Names" in VBA Excel


I need to list and modify some external link named in an xlsx file.

thanks for all help


Thanks for your query.

See the sample code below for your reference:
Sample code:

Workbook wb = new Workbook(“Book1.xlsx”);

// Create ExternalLinkCollection object to get the all the ext. links in the spreadsheet
ExternalLinkCollection elnks = wb.Worksheets.ExternalLinks;
ExternalLink elnk = elnks[0];
//elnk.AddExternalName(“test”, “=Sheet1!$B$2”);

Also, see the document(s) for your reference:

Hope, this helps a bit.

Thank you.

On the excel document we have defined some name refer to external file (for sample Name ‘BGN_1_Balance’ and refersTo =‘C:\WdSites20\RevisionComptable\Exe\Documents\10\DossierPeriodique\2014\FT\10201[BALGEN_N-1.xlsx]BALGEN_N-1’!$H:$J’
And I need now to update the directory . So, I need to know the name of the external link


Thanks for providing us further details.

For your case, you may try to use NameCollection and Name object which has Text and RefersTo attributes. See the sample code below for your reference:
Sample code:

Workbook wb = new Workbook(“e:\test2\Bk_names1.xlsx”);

WorksheetCollection worksheets = wb.Worksheets;
NameCollection names = worksheets.Names;
for (int i = 0; i < names.Count; i++)

//Get the name
//Get the refers to

Note: you may also try to use the same Name.Text and Name.RefersTo attributes to set or update the named ranges accordingly.

Let us know if I can be of any further help.

Thank you.


Hopefully, your issue is sorted out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.