This project has moved. For the latest updates, please go here.

Find external references (links) in a workbook

Jan 30, 2013 at 8:12 AM

Is it possible with this libriary to search and find external references in a workbook?

Coordinator
Jan 30, 2013 at 3:16 PM

You can use lambda's and add your search criteria:

worksheet.Cells(c => c.HasHyperlink)
worksheet.Cells(c => c.HasFormula)
Jan 31, 2013 at 7:32 AM
Edited Jan 31, 2013 at 9:03 AM
I do not have the c.HasFormula bool, am i missing something?

I know that the formula i am looking for looks like this:
='S:\test\[source1.xlsx]Sheet1'!A1
var wb = new XLWorkbook(@"S:\Refs.xlsx");
var ws = wb.Worksheet(1);
var cellValue = ws.Cell(1, 1).FormulaA1;
Console.WriteLine(cellValue);
With this code i get the following output:
[1]Sheet1!A!

Is it not possible to get the above formular as output?

The reason is that i am about to do a larger rearrangement of files whereas i need to find the files which several excel documents are refering to.
Coordinator
Jan 31, 2013 at 8:13 PM
Ah, I get it now. Sorry but external sources are not supported.

btw, .HasFormula is in the current source code but not yet released.