I've found this Private Sub online and i'm just looking for help implementing it into my routine:
I've put this in module3 of my book. The code I need it linking to is:
But i dont know how to implement it. Any help appreciated.
John
Code:
Private Function WorkbookIsOpen(wbname) As Boolean
' Returns TRUE if the workbook is open
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(wbname)
If Err = 0 Then WorkbookIsOpen = True _
Else WorkbookIsOpen = False
End Function
Code:
Sub UpdateTeam()
Dim wb As Workbook
ChDir ThisWorkbook.Path
ChDrive ThisWorkbook.Path
x = Application.GetOpenFilename
If x = False Then GoTo Cancel
Set wb = Workbooks.Open(x)
John