Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi.
I have this bit of code that is meant to check if a certain workbook is open and if it is its meant to tell the user to try again later. Unortunately it doesn't. It just skips the msgbox and carries on regardless. can anyone se the problem with the code please? Function BookOpen(Bk As String) As Boolean Dim T As Excel.Workbook Err.clear On Error Resume Next Set T = Application.Workbooks(Bk) BookOpen = Not T Is Nothing Err.clear On Error GoTo 0 End Function Sub OpenAWorkbook() Dim IsOpen As Boolean Dim Bookname As String Bookname = "\\Irf00743\lc ccg ctops bdap\Dissolutions\Holding folder\Todays Dissolution requests.xls" IsOpen = BookOpen(Bookname) If IsOpen Then MsgBox "The Dissolution Tool is curently in use. Please try again in a few minutes" Else End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking if another workbook is open | Excel Programming | |||
Checking if another workbook is open | Excel Programming | |||
Checking if Workbook is Open | Excel Programming | |||
Checking for open workbook... | Excel Programming | |||
Checking for Open Workbook | Excel Programming |