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 Capture Update Links Error?

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
Excel Links don't update error message even if it really does upda Lost in Excel Excel Discussion (Misc queries) 0 October 21st 08 04:42 PM
Workbook links between 2 files. Update error Hyperion Setting up and Configuration of Excel 0 October 24th 07 12:47 PM
Update Links Error... HoseHead78 Excel Discussion (Misc queries) 0 March 1st 06 07:44 PM
Capture Update Links event VBA will Daborn Excel Programming 2 July 19th 05 11:51 AM
upgrade to excel 2003 update broken links error tigger Links and Linking in Excel 0 December 1st 04 06:39 PM


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