This project is read-only.

External links

Feb 9, 2012 at 1:23 PM

Hi,

I'd like to enumerate all external links (links to other Excel worksbooks) in an Excel 2003 .xls file. Is it possible?

thanks,
Francois

Jun 16, 2012 at 3:33 AM

I too am looking for a way to do this. As it is, I loop through each cell, parse the cell's formula using RegEx to detect links. The detected links use strange characters instead of backslashes, and I replace those:

string replacedText = CellData;
replacedText = Regex.Replace(replacedText, @"[\u0002,\u0003]", @"\"); // fixes backslashes in path (root is char 2 (STX), others are char 3 (ETX))
replacedText = Regex.Replace(replacedText, @"\u0005\w", ""); // fixes http(s): paths (u0005 = ENQ)
replacedText = Regex.Replace(replacedText, @"\u0001@", @"\\"); // fixes UNC paths (u0001 = SOH)
replacedText = Regex.Replace(replacedText, @"(?:\u0001)(\w)", @"$1:\"); // fixes full-drive-letter-relative paths