owentmoore
Technical User
Hi All,
I am having a problem with error trapping a routine I have setup. If I enter an incorrect file path in the second file location listed in the code below, the error statement does not seem to work correctly. It should jump to line "End_Now:" but instead throws up error Run Time Error 76, Path Not Found.
The reason I need this to work is that all the users using this file may not have access to the file path, and if they don't I want the file to continue opening without alerting them.
Code is as follows:
Thanks
Owen
I am having a problem with error trapping a routine I have setup. If I enter an incorrect file path in the second file location listed in the code below, the error statement does not seem to work correctly. It should jump to line "End_Now:" but instead throws up error Run Time Error 76, Path Not Found.
The reason I need this to work is that all the users using this file may not have access to the file path, and if they don't I want the file to continue opening without alerting them.
Code is as follows:
Code:
Private Sub Workbook_Open()
Dim x As Integer
On Error GoTo log_it
Open "\\DPYIECOFPS01\HomeH$\omoore\Process Support\Consumables\log_me.txt" For Input As #1
Input #1, x
log_it:
x = x + 1
Close
On Error GoTo End_Now
Open "\\DPYIECOFPS01\HomeH$\omoore\Process Support\Consumables\log_me.txt" For Append As #1
Print #1, Environ$("username") + " Open " + " - " + Date$ + " - " + Time$
Close
GoTo End_Now
End_Now:
End Sub
Thanks
Owen