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: 92
Default Update Links

Hello. I have some code that mainly references a worksheets 2 columns -
column D has the full path of a file, column A has a checkbox. The code
opens every file (one at a tine) that is listed in column D with a check in
A, updates links, prints the sheets listed in columns E through BB, and then
finally closes the file. It then loops through all files listed.

My issue is this - if I come across a file that has bad links, I get the
popup message indicating so. When I choose do not update links, the code
errors out. What I would like to happen is that the file is still opened,
links do not get updated if there are bad links, the file is left open and
the loop continues. So in the end, the only files that are still open will
be by default files with bad links. Is this possible? Thanks!! My code is
below:

Sub PrintFiles()

Set rng = Range("D7:D" & Range("D65536").End(xlUp).Row)
For Each cell In rng
If Trim(cell.Value) < "" Then
If Cells(cell.Row, 1).Value = True Then
WbOpen = cell.Value
Workbooks.Open (WbOpen), UpdateLinks:=1
Set bk = ActiveWorkbook

ThisWorkbook.Activate
Set rng1 = cell.Offset(0, 1).Resize(1,
50).SpecialCells(xlConstants)
For Each cell1 In rng1
If LCase(cell1.Value) = "all" Then
bk.PrintOut
Exit For
Else
If Trim(cell1.Value) < "" Then
bk.Worksheets(cell1.Value).PrintOut
End If
End If
Next

WbOpen = ""
bk.Close SaveChanges:=True
Set bk = Nothing
End If
End If
Next

End Sub


 
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
update links kevcar40 Excel Discussion (Misc queries) 0 October 23rd 08 05:45 PM
Update links box gives Continue or Edit Links dialog KarenF Excel Discussion (Misc queries) 0 May 18th 07 01:17 PM
Excel 2003 - Update or Don't Update Links Problem Jamie Excel Programming 4 July 7th 05 02:08 PM
can't update links...can't find links GJR3599 Excel Discussion (Misc queries) 1 April 4th 05 04:56 PM
Don't update Links Robin Clay[_3_] Excel Programming 1 February 20th 04 02:04 PM


All times are GMT +1. The time now is 12:24 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"