hennahairgel
Board Regular
- Joined
- Feb 19, 2002
- Messages
- 63
I want to check if a workbook is open, an if not open it. How do I go about doing that then?
TIA
Henry
TIA
Henry
Function WBisOpen(Bk As String) As Boolean
Dim T As Workbook
Err.Clear
On Error Resume Next
Set T = Workbooks(Bk)
WBisOpen = Not (Err.Number > 0)
Err.Clear
On Error GoTo 0
End Function
On 2002-02-20 05:53, Juan Pablo G. wrote:
I use this function. It's similar to the last one proposed, but I don't like Activating the workbook, because you would have to reactivate your "working" workbook. Try this.
Code:Function WBisOpen(Bk As String) As Boolean Dim T As Workbook Err.Clear On Error Resume Next Set T = Workbooks(Bk) WBisOpen = Not (Err.Number > 0) Err.Clear On Error GoTo 0 End Function