xlsvbah13.1

01Attribute VB_Name = "mod1Oefeningen"
02 
03Option Explicit
04 
05Sub Oefening1()
06     
07    Dim wbWerkboek As Workbook
08    Dim strBestand As String
09     
10    strBestand = ActiveWorkbook.Path & "\Bronnen\Werkmap 1.xlsx"
11     
12    Set wbWerkboek = Workbooks.Open(strBestand)
13     
14End Sub
15 
16Sub Oefening2()
17 
18    On Error GoTo FoutAfhandelaar
19 
20    Dim wbWerkboek As Workbook
21    Dim strBestand As String
22     
23    strBestand = ActiveWorkbook.Path & "\Bronnen\Werkmap 4.xlsx"
24     
25    Set wbWerkboek = Workbooks.Open(strBestand)
26     
27    Exit Sub
28     
29FoutAfhandelaar:
30     
31    If Err.Number = 1004 Then
32        MsgBox "Het bestand: " & strBestand & " is niet gevonden!", vbCritical
33    End If
34 
35End Sub
36 
37Sub Oefening3()
38 
39    Dim wbWerkboek As Workbook
40    Dim strBestand As String
41     
42    strBestand = ActiveWorkbook.Path & "\Bronnen\Werkmap 4.xlsx"
43     
44    If Dir(strBestand) = "" Then
45        MsgBox "Het bestand: " & strBestand & " is niet gevonden!", vbCritical
46    Else
47        Set wbWerkboek = Workbooks.Open(strBestand)
48    End If
49 
50End Sub

Download hier het bestand.