LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Finding worksheets with Broken Links to other workbooks

Hi,

I have spent hours searching forums and trying in vain to reliably test
whether any workbook in a nominated folder structure contains invalid links.
It need to work in Excel XP & 2003.

I use FileSys/NewSearch to populate the FoundFiles object with all Excel
workbooks in the folder tree:
With FileSys
.NewSearch
.LookIn = ThisWorkbook.Path
.SearchSubFolders = True
'.Filename = "*.*"
.FileType = msoFileTypeExcelWorkbooks
.Execute
If Not .Execute() 0 Then
'No Excelworkbooks found
MsgBox "There were no files found."
End If
End With
then open each 1 (with update suppressed) and use LinkSources to populate
an array with all the external links from that workbook :
TargetLinks = TargetWorkBook.LinkSources(xlExcelLinks)

If I then try to loop through and check their status using:
TargetWorkBook.LinkInfo(TargetLinks(loopcounter),
xlLinkInfoStatus),
I get a meaningless result, as they have not been updated.
However, if I try updating them, using :
TargetWorkBook.UpdateLink Name:=TargetWorkBook.LinkSources

I get an "File Open" dialog for any broken links, although valid links will
produce a correct result. If I try setting DisplayAlerts = False, I get
"Runtime Error 1004, Method 'Update Link' of object '_Workbook' failed.

Am I going about this the wrong way? Is there a way to find all workbooks in
a folder tree containing broken links without opening them?

Please help while I still have some hair left :-)
--
Regards, Alan
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Broken Links JayBee Setting up and Configuration of Excel 2 August 11th 08 09:00 AM
Broken Links [email protected] Excel Discussion (Misc queries) 1 June 10th 08 07:21 PM
Help with Broken Links charles banks Excel Discussion (Misc queries) 5 March 16th 06 03:55 PM
broken links Doug T Excel Discussion (Misc queries) 6 November 19th 05 12:38 PM
Broken Links David Excel Discussion (Misc queries) 3 July 1st 05 02:19 AM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"