Albatros
Gebruiker
- Lid geworden
- 4 nov 2001
- Berichten
- 388
Hoi,
Via een hyperlink wil ik een bestand openen, echter als dit bestand niet bestaat, wil ik een melding krijgen (The file does not exist!")
In onderstaande macro krijg ik de melding ook, als het bestand wel bestaat. Waar ga ik de fout in?
Albatros
Via een hyperlink wil ik een bestand openen, echter als dit bestand niet bestaat, wil ik een melding krijgen (The file does not exist!")
In onderstaande macro krijg ik de melding ook, als het bestand wel bestaat. Waar ga ik de fout in?
Code:
Sub Macroklik2()
'
' Bestand openen via hyperlink
On Error GoTo Err
Application.Goto Reference:="R9C1"
Range("A9").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Err:
MsgBox "The file does not exist!"
Exit Sub
Windows("Macro - Bestand openene adhv celnaam.xlsm").Activate
End Sub
Albatros