Function GetWorkbook(ByVal sFullName As String) As Workbook
' Description: checks if workbook is open, opens if not
' Inputs: path and filename (string)
' Outputs: workbook object if path/filename was valid, otherwise Nothing
Dim sFile As String
sFile = Dir(sFullName)
On Error Resume Next
Dim wbReturn As Workbook
Set wbReturn = Workbooks(sFile)
If wbReturn Is Nothing Then
Set wbReturn = Workbooks.Open(sFullName)
End If
On Error GoTo 0
'RETURN
Set GetWorkbook = wbReturn
End Function