Checking For Open Files Including Path
Posted by Ken Brading on February 08, 2000 4:11 PM
I'm currently using the code listed below in a
host spreadsheet to check for open files.
Unfortunately it only checks the same directory
that contains the host spreadsheet even though I'm requesting
a different directory. How do I change the code
below for the host spreadsheet to look in other
directories?
Private Function WorkbookOpen(wbname) As Boolean
'Returns TRUE if the workbook is open
'This function needs to check the path as well as the workbook
Application.Volatile
On Error GoTo NotOpen
x = Workbooks(wbname).Name
WorkbookOpen = True
Exit Function
NotOpen:
WorkbookOpen = False
End Function
Ken Brading