One of the steps in a marco I'm working on is opening a workbook from another drive.
I've specified the location of the workbook with a private function:


Private Function document() As String
                document= "\\directory\example.xlsx"
End Function
It is on a network drive.
This means of course that depending on the user's physical location, the macro may or may not be able to find the network path.
How do I handle the possible error for this? My first idea was something like

if iserror(Workbooks.Open Filename:=document) = true then
[action]
else
[other action]
This should also give you some idea of the VBA skill level I'm at
Any pointers in the right direction are welcome!