Morning 
to prevent errors in my program i need to use my own procedure to check if a file selected to open is already open (the normal excel one causes problems).
i have the code below, but i will not know the name of the file.
the file name comes from GetOpenFileName so it is the complete path.
the Sub below does not work if the whole path is used instead of SC3001_s.txt.
so is there a way to check the full file path against the open files or else get just the file name to check against the open Workbooks.
Sub checkOpen()
Dim wksht As Workbook
For Each wksht In Application.Workbooks
If wksht.Name = "SC3001_s.TXT" Then
MsgBox "sheet already open"
End If
Next
End Sub
i hope this makes sence
thank you
to prevent errors in my program i need to use my own procedure to check if a file selected to open is already open (the normal excel one causes problems).
i have the code below, but i will not know the name of the file.
the file name comes from GetOpenFileName so it is the complete path.
the Sub below does not work if the whole path is used instead of SC3001_s.txt.
so is there a way to check the full file path against the open files or else get just the file name to check against the open Workbooks.
Sub checkOpen()
Dim wksht As Workbook
For Each wksht In Application.Workbooks
If wksht.Name = "SC3001_s.TXT" Then
MsgBox "sheet already open"
End If
Next
End Sub
i hope this makes sence
thank you