To answer post #1 directly, here is how to check if any file open "by you". I will show code in a bit that shows how to check if any are open by anyone.
The last MsgBox in Main() shows 0 if none are open.
Be sure to set the reference as commented. Obviously, change the two input parameter values for fFiles() to suit.
Sub Main()
Dim a() As Variant
'a() = fFiles("C:\MyFiles\Excel\old", "*.xls;*.xlsx")
a() = fFiles("C:\MyFiles\Excel\gps", "*.xlsx")
MsgBox Join(a, vbLf)
MsgBox NumFilesOpen(a)
End Sub
Function NumFilesOpen(filesArray()) As Long
Dim x As Long, i As Long, s() As String
x = 0
For i = 0 To UBound(filesArray)
s() = Split(filesArray(i), "\")
If IsWorkbookOpen(s(UBound(s))) Then x = x + 1
Next i
NumFilesOpen = x
End Function
'Add reference: Microsoft Shell Controls and Automation
Function fFiles(aPath As Variant, Optional sFilters As String = "*.*") As Variant
Dim objShell As Shell, objFolder As Folder
Dim i As Long, a() As Variant
Dim objFolderItems3 As FolderItems3
'Dim ssfWINDOWS As Long, SHCONTF_NONFOLDERS As Long
'ssfWINDOWS = 36 'c:\windows
'SHCONTF_NONFOLDERS = 64 'Files
Set objShell = New Shell
Set objFolder = objShell.Namespace(aPath)
If objFolder Is Nothing Then Exit Function
Set objFolderItems3 = objFolder.Items
If objFolderItems3 Is Nothing Then Exit Function
objFolderItems3.Filter 64, sFilters
With objFolderItems3
If .Count = 0 Then Exit Function
ReDim a(0 To .Count - 1)
For i = 0 To .Count - 1
a(i) = objFolderItems3.Item(i).Path
Next i
End With
Set objFolderItems3 = Nothing
Set objFolder = Nothing
Set objShell = Nothing
fFiles = a()
End Function
Function IsWorkbookOpen(stName As String) As Boolean
Dim Wkb As Workbook
On Error Resume Next ' In Case it isn't Open
Set Wkb = Workbooks(stName)
If Not Wkb Is Nothing Then IsWorkbookOpen = True
'Boolean Function assumed To be False unless Set To True
End Function