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: 3
Default Error trapping don't work

Hi all,

A colleague at work has an xl file that is linked to about 10 other
password-protected files over a winNT network. He want those files opening
without having to laboriously type in passwords in order to update his
master copy. The code below does work (it's behind a third file called
CodeFile.xls, but when i attempt to error trap I receive the usual Debug |
End |Help dialog box. Please can someone help as the vba is useless without
knowing which, if any, files failed to open (i.e. cos they were moved,
changed, deleted by other users).

Private Sub CommandButton1_Click()
On Error GoTo ErrorHandler

Workbooks.Open Filename:="blah\blah\Link.xls", updateLinks:=3, _
password:="gollum"
Workbooks.Open Filename:="blah\Master.xls", updateLinks:=3

Workbooks("Link.xls").Close

Exit Sub

ErrorHandler:
Select Case Err.Number

Case 1004
MsgBox "The file Could not be found", vbOKOnly + vbCritical, "Error"

Case Else
MsgBox (Err.Number & Err.Description)
End Select
Resume 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
Error Trapping gazza67[_2_] Excel Discussion (Misc queries) 2 September 6th 07 06:11 PM
Trapping #VALUE! error RhysPieces Excel Discussion (Misc queries) 6 August 22nd 07 03:13 AM
error trapping flow23 Excel Discussion (Misc queries) 3 April 13th 06 04:51 PM
Error Trapping Neil Excel Programming 1 January 5th 04 04:38 PM
error trapping libby Excel Programming 5 November 25th 03 10:57 PM


All times are GMT +1. The time now is 09:26 AM.

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"