If you need to reference a workbook, which might already be opened but all you have ready is the file path the following function will do the trick for you.
If the Excel workbook is not opened oran opened workbook with the same name is not saved under given file path, Nothing will be returned.
' @Author - Alexander Bolte
' @Change Date - 2013-12
' @Description - Returns a workbook object referencing an Excel file
' available under given file path, if the Excel file was already opened before calling this function.
' @Param filePath - a path to an Excel file.
' @Returns - a workbook object referencing an Excel file available under given file path.
Public Function getOpenedWorkbook(ByVal filePath As String) As Workbook
Dim ret As Workbook
Dim wrkName As String
Dim sep As String
Dim splitted() As String
On Error GoTo errHandle:
' Get the separator for path strings on operating system.
sep = Application.PathSeparator
splitted = Split(filePath, sep)
wrkName = splitted(UBound(splitted))
Set ret = Application.Workbooks(wrkName)
If ret.path <> filePath Then
ret = Nothing
If Err.Number <> 0 Then
Set getOpenedWorkbook = ret