in reply to detect hyperlink in an excel file

First, I don't know what a hyperlink's "style" is, but that may be down to my ignorance on all matters HTML. Second, your code is using .xlsx, which implies to me Excel 2007 or later. I haven't used these enough to know the technicalities, and I don't have a copy myself. I can't find a direct way to do this in 2002/2003 VBA, as the Sheet.Hyperlinks(index) object seems extremely buggy. For me, it always returns the last one in the sheet, regardless of the index it is given. But it is possible to do something for that one hyperlink that may be good enough for what you want. AFAICT, .Address returns the formula and .Range returns the evaluated text. This won't deal with situations where the author has written a hyperlink something like ="http://"&"www.google.com", but that may be rare enough for you not to care, or it may be possible to sort out such anomalies manually. Assuming away all the problems above, my pseudocode would be:
use Win32::OLE; Create new instance of Excel Open target file read-only for (1..$wb->Sheets->count){ for ($sht->Hyperlinks->Count; 1; -1) { if ($hl->Range ne $hl->Address) { Do something interesting } $hl->Delete $wb->SaveAs(TempFile) $wb->Close; Open Tempfile } }
Note that this is very pseudo, and will need you to do a lot of fleshing out. But it may work.

Regards,

John Davies

Update: corrected bug in pseudocode