Hi. I can open a file remotely but am trying to create an error handling routine where, if the file is closed, open and update the links. If the file is already open it gives a FileInUse error and gives you the option to open it as read only
I have been messing around with some code and ended up here:
Weirdly it comes back with a compile error "else without if" statement. Has the colon impacted this in a strange way? Could this be made more robust?
Thanks
Paul
I have been messing around with some code and ended up here:
Code:
Dim Filename as string
Filename = whatever the path is
Workbooks.Open (filename)
If FileInUse (filename) Then Workbooks.Open (filename), Notify:=False
Else: Workbooks.Open (filename), UpdateLinks:=3
End If
Weirdly it comes back with a compile error "else without if" statement. Has the colon impacted this in a strange way? Could this be made more robust?
Thanks
Paul